Leuselator
Programmer
Hi all!
Got a principal prob here with selfemade components:
Descendend of TPanel creates dynamicaly a child TPanel on it.
If I place Controls on the ChildPanel in IDE (Designtime) they 'disapear' @ runtime.
Help apreciated
To do a quick test here's da code:
unit TestPanel;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TTestPanel = class(TPanel)
private
{ Private-Deklarationen }
ChildPanel : TPanel;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor destroy; override;
published
{ Published-Deklarationen }
end;
procedure Register;
implementation
constructor TTestPanel.Create(AOwner: TComponent);
begin
inherited create(AOwner);
width := 400;
Height := 200;
Caption := ' Motherpanel keeps its controls';
ChildPanel := TPanel.create(AOwner);
ChildPanel.Parent := self;
ChildPanel.left := 5;
ChildPanel.Top :=5;
ChildPanel.Width := 190;
ChildPanel.Height := 190;
ChildPanel.Caption := 'Childpanel looses its controls';
end;
destructor TTestPanel.destroy;
begin
ChildPanel.Free;
inherited;
end;
procedure Register;
begin
RegisterComponents('TestPanel', [TTestPanel]);
end;
end.
Got a principal prob here with selfemade components:
Descendend of TPanel creates dynamicaly a child TPanel on it.
If I place Controls on the ChildPanel in IDE (Designtime) they 'disapear' @ runtime.
Help apreciated
To do a quick test here's da code:
unit TestPanel;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TTestPanel = class(TPanel)
private
{ Private-Deklarationen }
ChildPanel : TPanel;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor destroy; override;
published
{ Published-Deklarationen }
end;
procedure Register;
implementation
constructor TTestPanel.Create(AOwner: TComponent);
begin
inherited create(AOwner);
width := 400;
Height := 200;
Caption := ' Motherpanel keeps its controls';
ChildPanel := TPanel.create(AOwner);
ChildPanel.Parent := self;
ChildPanel.left := 5;
ChildPanel.Top :=5;
ChildPanel.Width := 190;
ChildPanel.Height := 190;
ChildPanel.Caption := 'Childpanel looses its controls';
end;
destructor TTestPanel.destroy;
begin
ChildPanel.Free;
inherited;
end;
procedure Register;
begin
RegisterComponents('TestPanel', [TTestPanel]);
end;
end.