0

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.enter image description here

alitrun
  • 1,047
  • 8
  • 14

1 Answers1

4

Use

  1. SetSubComponent(True);

  2. 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?

Remy Lebeau
  • 505,946
  • 29
  • 409
  • 696
alitrun
  • 1,047
  • 8
  • 14