Reputation: 1218
I'm creating simple component inherited from TControl (Firemonkey). In constructor I wrote :
constructor TControl1.Create(AOwner: TComponent);
begin
inherited;
fTest := TLayout.Create(Self);
fTest.Parent := Self;
end;
How when I place this component to the form, Structure list shows Tlayout as subcomponent as <components1>. How can I hide it?
See screenshot.
Upvotes: 0
Views: 468
Reputation: 1218
Use
SetSubComponent(True);
Owner
must be Self
constructor TControl1.Create(AOwner: TComponent);
begin
inherited;
fTest := TLayout.Create(Self);
fTest.SetSubComponent(True);
fTest.Parent := Self;
end;
Here is also similar question:
How to disable child controls at design-time?
Upvotes: 4