procedure TForm1.Button1Click(Sender: TObject);
var
i, j : integer;
strList : TStringList;
begin
strList := TStringList.Create;
strList.Add('aaaaaaa');
strList.Add('bbbbbbb');
strList.Add('ccccccc');
strList.Add('ddddddd');
j := 0;
for i := 0 to Self.ComponentCount -1 do
begin
if Self.Components[i] is TEdit then
begin
TEdit(Self.Components[i]).Text := strList.Strings[j];
j := j + 1;
end;
end;
strList.Free;
end;
应该自己搜索一下先的,太懒了。。。
第一个回文的,分数都拿去。
procedure TForm1.Button1Click(Sender: TObject);
var
i : Integer;
begin
for i := 0 to Form1.ControlCount-1 do
begin
if Form1.Controls[i] is TEdit then
ShowMessage( Form1.Controls[i].Name );
end;
end;