const length=10;
var
btn:array[0..10] of Tbutton;
begin
for
begin
btn[i]:=tbutton.create(self);
btn[i].x =
btn[i].y =
btn[i].parent =
btn[i].caption := inttostr(i);
end;
......
var
btn:array[0..10] of Tbutton;
begin
for
begin
btn[i]:=tbutton.create(self);
btn[i].x =
btn[i].y =
btn[i].parent =
btn[i].caption := inttostr(i);
end;
......
...............
public
button:array[0..100]of tbutton;
..............
procedure CreateButton;
var
i;integer;
begin
for i:= 0 to 100 do
begin
button[i]:=tbutton.create(form1);
with button[i] do
begin
parent:=form1;
width:=100;
height:=30;
caption:='button'+inttostr(i);end;
end;
end;
好像是
var
button:array of Tbutton;
procedure..........
begin
for I:=0 to n do
begin
button[i].create(form1);
button[i].parent(form1);
END;
END;
Var
loop,i :integer;
begin
i :=0;
for loop := 0 to ComponentCount-1 do//遍历全部组件
if (Components[loop] is TButton) then//判断是否是TButton
begin
i := i + 1;
(Componets[loop] as TButton).Caption := IntToStr(i);
end;
end;
TButton(Sender).tag的值进行判断!
if tag=1 then TButton(Sender).caption:='';
祝你好运!