Ich schätze, du musst das ganze rekursiv lösen. Kann aber selbst kein C...
Hab mal einen Delphi-Code geschrieben, der alle Namen der TMemos auf dem Formular rekursiv auflistet. Das clearen geht halt dementsprechend.
Delphi-Quellcode:
procedure GetMemoNames(AParent: TControl; AList: TStrings);
var i: Integer;
begin
for i:= 0 to AParent.ComponentCount-1 do
begin
if AParent.Components[i] is TMemo then
AList.Add(AParent.Components[i].Name); // TMemo(AParent.Components[i]).Clear;
if AParent.Components[i] is TControl then
GetMemoNames(TControl(AParent.Components[i]),AList);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var sl: TStringlist;
begin
sl := TStringlist.Create;
try
GetMemoNames(Self,sl);
ShowMessage(sl.Text);
finally
sl.Free;
end;
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."