詹 詹仕蛟 Unregistered / Unconfirmed GUEST, unregistred user! 2000-12-23 #1 您好!很高兴你能看到我的提问。有一个问题我一直不能够解决,就是怎么样让一组 相同的控件像数组一样循环。
S Sunny18 Unregistered / Unconfirmed GUEST, unregistred user! 2000-12-23 #2 用控件的tag属性,设有10个button分别设它们的tag为0--9或1--10 然后用buttonX.tag来区分他们,也就实现了你说的功能!
L lilor Unregistered / Unconfirmed GUEST, unregistred user! 2000-12-23 #5 type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } btnarr: array[1..2] of ^TButton; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin btnarr[1]:=@Form1.Button1; btnarr[2]:=@Form1.Button2; end; procedure TForm1.Button2Click(Sender: TObject); var i: integer; begin for i:=1 to 2 do begin btnarr.caption:='No.'+inttostr(i); end; end;
type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } btnarr: array[1..2] of ^TButton; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin btnarr[1]:=@Form1.Button1; btnarr[2]:=@Form1.Button2; end; procedure TForm1.Button2Click(Sender: TObject); var i: integer; begin for i:=1 to 2 do begin btnarr.caption:='No.'+inttostr(i); end; end;
F failureman Unregistered / Unconfirmed GUEST, unregistred user! 2000-12-23 #6 ahm控件套餐中有,具体名字我忘了,很好用的,不信你试试.