X xiaolin0522 Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-29 #1 直接写50个语句太麻烦了? 控件数组什么搞? 能把已经定义的一组控件 搞成一个数组吗?
K kingdeezj Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-29 #2 for n:=0 to form1.ComponentCount-1 do begin if UpperCase(TComponent(Components[n]).ClassName)='TLABEL' then begin TLABEL(Components[n]).Text='111'; end;
for n:=0 to form1.ComponentCount-1 do begin if UpperCase(TComponent(Components[n]).ClassName)='TLABEL' then begin TLABEL(Components[n]).Text='111'; end;
D DEN Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-29 #4 var aryLbl: Array[0..49] of TLabel; begin for i:= 0 to 49 do begin aryLbl:= TLabel.Create(Self); aryLbl.caption:= artStr; ....... end; end;
var aryLbl: Array[0..49] of TLabel; begin for i:= 0 to 49 do begin aryLbl:= TLabel.Create(Self); aryLbl.caption:= artStr; ....... end; end;