[Lazarus] Nested Components in a Form at runtime

Andreas Frieß friess at gmx.at
Thu Feb 15 19:03:37 CET 2018


For testing purposes, i want to create a form at runtime with chained
panels - to make it simple.

I use this code


  // Create components
  ATestForm :=  TForm.Create(nil);
  ATestForm.Name:= 'Main';
  // Create a Panel
  ATestPanel := TPanel.Create(ATestForm);
  ATestPanel.Parent:=ATestForm;
  ATestPanel.Name:='PanelA';
  ATestPanel.Caption:= 'Panel';
  // Create in the panel a panel (to see the chain)
  ATestPanelSub := TPanel.Create(ATestPanel);
  ATestPanelSub.Parent := ATestPanel;
  ATestPanelSub.Name:= 'SubPanelA';
  ATestPanelSub.Caption:= 'Sub Panel';

but in the ObjectInspector (used at runtime) i see only the PanelA, not
the nested ATestPanel. What do i wrong or have misunderstood ?

What is the differnt to Lazarus at desdigntime ? When i place there a a
Pnale in a Panel it works.

Andreas   



More information about the Lazarus mailing list