帮帮我 动态创建的控件怎么取值时时空的
代码如下
procedure TForm1.Button2Click(Sender: TObject);
var
i:integer;
begin
for i=1 to 3
begin
with Tedit.Create(self) do
begin
name:='et'+inttostr(i);
parent:=self;
width:=160;
text:='uuuu';
Left :=width+100;
Top :=width+100;
//Visible:=false;
end;
end
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(findComponent('ed'+'1')as TEdit).text) ;
end;
在输入值后显示为什么是空的