[Lazarus] Nested Components in a Form at runtime

Ondrej Pokorny lazarus at kluug.net
Thu Feb 15 22:02:21 CET 2018


On 15.02.2018 19:03, Andreas Frieß via Lazarus wrote:
> 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.

I didn't know you can use the object inspector to inspect 
controls/components in runtime. How to enable it? Is this documented 
somewhere?

Ondrej


More information about the Lazarus mailing list