使用循环完成:
for i ;= 1 to 30 do
begin
TEdit(findcomponent('edit' + inttostr(i))).text := i;
end;
for i ;= 1 to 30 do
begin
TEdit(findcomponent('edit' + inttostr(i))).text := i;
end;
解决方案 »
- 一个关于用mysql存取图片的问题,大家进来讨论一下
- 数据类型
- 修改table中的某条纪录
- 用TActionManager作出来个菜单,点击时候咋没反映?【在线等】
- 如何架设代理服务器,来实现玩台服天堂2
- up有分,如何把F1book设置成象其它delphi控件那样的只读属性,只是把cell的内容设置成不能改?
- DELPHI如果结合SQL SERVER用ADO来生成数据库应用程序,发布的时候要怎样呢....
- 一个有关MIDAS的问题,它已经困惑我很久了!!UP也有分!!
- 请帮忙翻译一些代码,谢谢!
- SQL高手请进!
- 关于视频编程,高手帮帮我!
- !!!!!!Acrobat 5.0 中怎么使用金山词霸的屏幕取词?
TForm1...
public
EditList:TStringList;
end;
....
TForm1.Form1Create(Sender:TObject);
var
iCount:Integer;
begin
EditList := TObjectList.Create;
for iCount := 0 to ComponentCount - 1 do
begin
if Components[iCount] is TEdit then
begin
EditList.Add(Components[iCount]);
end;
end;
end;/////////////////////////
//可以用了,知道怎么用吗?
/////////////////////////TForm1.Form1Destroy(Sender:TObject);
begin
//如果
EditList.Free;
end;
好像不怎么全
begin
TEdit(findcomponent('edit' + inttostr(i))).text := i;//没有Edit1会出错
end;
var
vComponent: TComponent;
I: Integer;
begin
for I ;= 1 to 30 do begin
vComponent := FindComponent('Edit' + IntToStr(I));
if Assigned(vComponent) then TEdit(vComponent).Text := StrToInt(I);
end;
end;
var
vComponent: TComponent;
I: Integer;
begin
for I ;= 1 to 30 do begin
vComponent := FindComponent('Edit' + IntToStr(I));
if Assigned(vComponent) then TEdit(vComponent).Text := StrToInt(I);
end;
end;