我动态创建了5个按钮,
Button1,ButtonA,Button4,ButtonW,Button8:TButton;
想把他们保存在TList中,要访问时只要循环就好for i := 0 to List.Count-1 do
begin
TButton(List[i]).caption;
end;有没有这样的TList呢?
Button1,ButtonA,Button4,ButtonW,Button8:TButton;
想把他们保存在TList中,要访问时只要循环就好for i := 0 to List.Count-1 do
begin
TButton(List[i]).caption;
end;有没有这样的TList呢?
BB: Array [0..4] of Tbutton;然后 BB[0]:= BUTTON1;
BB[4]:=BUTTON5;以后直接BB[0]就可以控制指定按钮了
如果数组不等 你就
var
BB: Array of Tbutton; Setlenth(BB, n) n=数量也是不错的选择。供参考。