procedure TF_FY.other_ena;
var i:integer;
begin
for i:=0 to panel5.ControlCount -1 do
begin
if (panel5.Controls[i] is TEdit) or (panel5.Controls[i] is Tcombobox) then
Tedit(panel5.Controls[i]).Color:=clActiveBorder;
Tedit(panel5.Controls[i]).Enabled:=false;
TComboBox(panel5.Controls[i]).Color:=clActiveBorder;
end;
end;
如果像上面那样做,panel中的所有控件都不可用,但我只想让edit和combobox控件不可用,请各位指点?
解决方案 »
- 一个播放器的代码,有好多错,我都不知道该怎么改了,帮忙看下
- RichView 图片问题
- 一个动态创建组件的问题:在Form上放一个Button,Click后动态生成一个相同的Button,出现在原先Button的右下角,且具有与原先Button同样
- 救命啊!菜鸟快不行了!
- 如何用ocx捕获ie(调用者)的关闭消息
- 毕业设计(对高手来说应该很容易)
- Delphi的前景怎样?
- 怎样在ListBox中实现多列
- 关于增删StringGrid行列的问题,以前的CSDN并未解决。
- 请教各位!如何在程序中调出修改系统时间的窗体!!(就是双击右下脚‘时间’时出现的窗体)!谢谢各位帮忙!!
- 谁知道vcd, dvd author组件或相关资料?
- 急求 Delphi编写 三次样条插值函数
begin
if Components[i] is TEdit then
begin
((Components[i]) as TEdit).Enabled := false;
end
else if Components[i] is TMemo then
begin
((Components[i]) as TMemo).Enabled :=False;
end
else if Components[i] is TComboBox then
begin
((Components[i]) as TComboBox).Enabled :=False;
end;
end;
begin
if (panel5.Controls[i] is TComboBox) then
begin
TComboBox(panel5.Controls[i]).Color := clActiveBorder;
TComboBox(panel5.Controls[i]).Enabled := False;
end
else if (panel5.Controls[i] is TEdit) then
begin
TEdit(panel5.Controls[i]).Color := clActiveBorder;
TEdit(panel5.Controls[i]).Enabled := False;
end;
end;
用as
var i:integer;
begin
for i:=0 to panel5.ControlCount -1 do
begin
if (panel5.Controls[i] is TEdit) or (panel5.Controls[i] is Tcombobox) then
begin
Tedit(panel5.Controls[i]).Color:=clActiveBorder;
Tedit(panel5.Controls[i]).Enabled:=false;
TComboBox(panel5.Controls[i]).Color:=clActiveBorder;
end;
end;
end;