若你真的要100个就看下面
var
Label1 :Array[1..100] of TLabel ;
i :Byte ;
begin
for i:= 1 to 100 do
begin
Label1[i] := TLabel.Create(Form1) ;
with Label1[i] do
begin
Parent := Form1 ;
Caption := Inttostr(i) ;
end ;
end ;
end ;
var
Label1 :Array[1..100] of TLabel ;
i :Byte ;
begin
for i:= 1 to 100 do
begin
Label1[i] := TLabel.Create(Form1) ;
with Label1[i] do
begin
Parent := Form1 ;
Caption := Inttostr(i) ;
end ;
end ;
end ;
解决方案 »
- 寻找与ImageList类似控件
- 请问{$IF DEBUG}{$ELSE}{$IFEND}是什么意思?
- dxdbgrid控件能否不自动按分组排序问题?
- ★ 软件产品登记 与 软件著作权登记 有什么区别???其各自作用是什么???行业协会网站上什么都没有!!
- 一个新手问题,关于修改Caption后执行一Function后才会显示
- webbrowser中打开新窗体的问题。
- bmp与其他格式的转化
- 控件转换成图形,然后再打印
- 谁有类似windows画图板的源程序?
- 小弟编了一个ActiceX组件,相加一个属性页,但搞不定,请大侠指教。
- 四川省成都市宾江路113号怎么翻译啊
- 急,急,急!!!有关存储过程及查询分析器的问题,请高手请教!
procedure TForm1.Button2Click(Sender: TObject);
var
i: Integer;
const
NamePrefix = 'MyEdit';
begin
for i := 1 to 100 do
begin
TEdit.Create(Self).Name := NamePrefix + IntToStr(i);
with TEdit(FindComponent(NamePrefix + IntToStr(i))) do
begin
Left := 10;
Top := i * 20;
Parent := self;
end;
end;
end;
var
S:String;
Edit1:TEdit;
begin
For i:=1 to 100 do
begin
S:='A'+inttostr(i);
Edit1:=TLabel.create(form1);
Edit1.Name:=S;
Edit1.Caption:='ddd';
edit1.Parent := Form1;
end;
end;