设置edit的tag属性为1到10
name属性为edit1到edit10
var
temp:tcomponent;
i:integer
tempedit:tedit;
begin
....
for i:=0 to form1.componentcount-1 do
begin
Temp := form1.Components;
if (Temp is Tedit) then
begin
tempedit:=(temp as tedit);
if copy(tempedit.name,1,4)='edit' then tempedit.caption:=inttostr(tempedit.tag);
end;
end;
....
end;