看一下如下代码:
var
TmpList1,TmpList2,TmpList3,TmpList4, : TStringList;
i : integer;
begin
TmpList1 := TStringList.Create;
TmpList2 := TStringList.Create;
TmpList3 := TStringList.Create;
TmpList4 := TStringList.Create;
for i := 0 to Component.Count -1 do
begin
if Sender is Tedit then
begin
TmpList1.Add((Sender as Tedit).Text);
end;
if Sender is TListBox then
begin
TmpList2.Add ....
end;
....
end;