本文整理自网络,侵删。
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 条件编译语法 $ifdef $else $endif
Delphi twebbrowser 响应回车键(ewb响应正常,无需额外代码)
Delphi中调用api函数exitwindowsex可以实现系统的关机,注销,和重启
更多相关阅读请进入《Delphi》频道 >>