請問在delphi中能否實現或者模擬控件數組的功能? 例如: 我想在edit控件得到焦點時改變顏色,在失去焦點時改回來,當edit很多時,我能不能用一行代碼完成呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.Button1Click(Sender: TObject);var iLoop:Integer;begin for iLoop :=0 to Self.ComponentCount-1 do begin if (Self.Components[iLoop] is TEdit) then begin TEdit(Self.Components[iLoop]).Color := clGreen; end; end;end; 楼上的正确,如果只判断Edit的话,可以将ComponentCount换成ControlCount,会增加一点点效率,将相应的Components换成Controls 关于LISTBOX的小问题 高分求,急急急,Delphi 编辑框格式验证 cxgrid问题.列铺满问题? 关于Delphi对Vcl和自定义组件的跟踪!郁闷中..... 关于stringGrid的Cell内容修改恢复及显示格式问题。。。 为什么会could not obtain ole control window handle 如果以后向DELPHI方面发展的话,找工作之前要有个什么基础 关于指针的问题! 请教高手:关于线程的问题。 calendar急要(请帮我) 大虾请指点一下 可以用 DELPHI 6 的WEB SERVERS 开发WEB方式的应用程序吗??
var
iLoop:Integer;
begin
for iLoop :=0 to Self.ComponentCount-1 do
begin
if (Self.Components[iLoop] is TEdit) then
begin
TEdit(Self.Components[iLoop]).Color := clGreen;
end;
end;
end;