如果在运行期才知道
要动态分配多少个控件,比如说count个lable控件想用一条for语句实现
如
for i:=0 to count do
begin
:=Tlable.Creat(Form1);
......
end;
可是delphi里没有控件数组
我即使定义了mlable1,mlable2也没用
请问该怎么解决啊
要动态分配多少个控件,比如说count个lable控件想用一条for语句实现
如
for i:=0 to count do
begin
:=Tlable.Creat(Form1);
......
end;
可是delphi里没有控件数组
我即使定义了mlable1,mlable2也没用
请问该怎么解决啊
Slable:array[1..10] of Tlable;
i:=integer;
begin
for i:=1 to 10 do
begin
Slable[i]:=Slable.create(self);
Slable[i].parent:=Panel1;
Slable[i].caption:='第'+inttostr(i)+'个';
Slable[i].top:=i*50+10;
Slable[i].left:=i*50+10;
end;
end;
Slable:array[1..10] of Tlable;
ll:Table;
i:=integer;
begin
for i:=1 to 10 do
begin
ll:=Slable.create(self);
ll.parent:=Panel1;
ll.caption:='第'+inttostr(i)+'个';
ll.top:=i*50+10;
ll.left:=i*50+10;
Slable[i]:=ll;
end;
end;
改..
Slable[i]:=tlabel.create(self);二楼代码是垃圾..