Hallo
ich versuche, alle childs einer Komponente, und auch deren childs usw. aufzuzeigen.
Beispiel: auf einer Form liegt Panel1.
Auf Panel1 liegen Panel2 und Button1.
Auf Panel2 liegt Button2.
Nun sollen alle child-Elemente von Panel1 und deren childs gezeigt werden.
Ich probiere das rukursiv mit controls, erhalte aber eine Fehlerlmeldung:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| procedure TForm1.GetControls (Contrl : TWinControl); var i : integer; co : TWinControl; begin for i := 0 to contrl.ControlCount - 1 do begin co := contrl.Controls [i]; --> Fehler:"Inkompatible Typen: 'TWinControl' und 'TControl'" showmessage (contrl.Name); GetControls (co); end; end; |
Danke für Hilfe: Daniel Lutz