本文整理自网络,侵删。
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
for i:= 1 to 6 do
begin
TLabel(FindComponent('Label' + IntToStr(i))).Caption := '我是'+inttostr(i)+'号';
//TEdit(FindComponent('Edit' + IntToStr(i))).Caption := '我是'+inttostr(i)+'号';
end;
end;
这样能够
相关阅读 >>
Delphi 获取随机字符串的方法 thash.getrandomstring
更多相关阅读请进入《Delphi》频道 >>