兄弟呀,哪来这样的用法啊?
要实现你说的效果,必需用动态控件。下面就是一个例子,
看完后,你应该就会改了。
不行的话给我发email:yuan-fan@21cn.com
var
Form1: TForm1;
x:array of tedit;
n:Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
SetLength(x,5);
for n:=0 to 4 do
begin
x[n]:=tedit.Create(self);
x[n].Parent:=Form1;
x[n].Left:=10;
x[n].Top:=n*30+10;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
for n:=0 to 4 do
x[n].Text:=IntToStr(n*2+10);
end;