Thema: Delphi Parent Problem

Einzelnen Beitrag anzeigen

IngoD7

Registriert seit: 16. Feb 2004
464 Beiträge
 
Delphi 7 Enterprise
 
#7

Re: Parent Problem

  Alt 17. Jan 2007, 12:20
Ich verstehe wohl das Problem nicht ....

Du hast eine Klasse TMyClass, die aus einem Panel mit einer ComboBox darauf besteht.
Dann solltest du auch alle notwendigen Schritte der Erstellung im Konstruktor deiner Klasse vornehmen.
Delphi-Quellcode:
constructor TMyClass.Create(Compo:TComponent);
  begin
  inherited;
  parent:=TWinControl(Compo);
  combo:=TCombobox.Create(self);
  combo.Parent:=self;
  end;
Dann kannst du anschließend also nach dem X:=TMyClass.Create(Form1); im Hauptteil des Programms tun und lassen was du möchtest.
  Mit Zitat antworten Zitat