ChildSizing -don't work runtime lazarus / 31-LCL ---------------------------------------------------------------------- J-23 · 2020-04-26 21:31 Hello, Why doesn't the "Layout" function from the "Childsize" subset work for components created at run time? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  FFormEditor: TForm;  FHeaderPanel: TPanel;  FHederText: TLabel;  FDescriptionText: TLabel;  FFormFooter: TBevel;  FCenterPanel: TPanel;  FGroupBoxLazarus: TGroupBox;  FGroupBoxComponent: TGroupBox;begin  FFormEditor := TForm.CreateNew(Application);  FFormEditor.Caption := 'Palette Editor';  FFormEditor.Height := 600;  FFormEditor.Width := 400;  FFormEditor.Position := poDesktopCenter;  FFormEditor.BorderStyle := bsSingle;  FFormEditor.BorderIcons := [biSystemMenu];   FCenterPanel := TPanel.Create(FFormEditor);  FCenterPanel.BevelInner := bvNone;  FCenterPanel.BevelOuter := bvNone;  FCenterPanel.Align := alClient;  FCenterPanel.ChildSizing.EnlargeHorizontal := crsScaleChilds;  FCenterPanel.ChildSizing.EnlargeVertical := crsScaleChilds;  FCenterPanel.Parent := FFormEditor;   FGroupBoxLazarus := TGroupBox.Create(FCenterPanel);  FGroupBoxLazarus.Align := alClient;  FGroupBoxLazarus.Caption := 'Lazarus Palette';  FGroupBoxLazarus.Parent := FCenterPanel;    FGroupBoxComponent := TGroupBox.Create(FCenterPanel);  FGroupBoxComponent.Align := alClient;  FGroupBoxComponent.Caption := 'Component Palette';  FGroupBoxComponent.Parent := FCenterPanel;   FFormFooter := TBevel.Create(FFormEditor);  FFormFooter.Shape := bsTopLine;  FFormFooter.Align := alBottom;  FFormFooter.Parent := FFormEditor;   FHeaderPanel := TPanel.Create(FFormEditor);  FHeaderPanel.BevelInner := bvNone;  FHeaderPanel.BevelOuter := bvNone;  FHeaderPanel.Align := alTop;  FHeaderPanel.Color := clWindow;  FHeaderPanel.Parent := FFormEditor;   FHederText := TLabel.Create(FHeaderPanel);  FHederText.Caption := FFormEditor.Caption;  FHederText.Font.Color := clBlack;  FHederText.Font.Style := [fsBold];  FHederText.Top := 8;  FHederText.Left := 8;  FHederText.Parent := FHeaderPanel;   FDescriptionText := TLabel.Create(FHeaderPanel);  FDescriptionText.Caption := 'Component palette configuration';  FDescriptionText.Top := FHederText.Height + 4;  FDescriptionText.Left := 16;  FDescriptionText.Parent := FHeaderPanel;  FFormEditor.Show;  FCenterPanel. ChildSizing.Layout := cclLeftToRightThenTopToBottom; -- this don't workend;  If we create the form with the IDE designer then everything works fine. ---------------------------------------------------------------------- jamie · 2020-04-26 22:07 interesting looking code I might add..  have you tried setting that property before adding any child controls to the Tpanel ? Its very possible that is a one time set.. in other words it doesn't  reorganize the child controls when set after the fact.  This is just a theory on my part .. ---------------------------------------------------------------------- winni · 2020-04-26 22:15 Hi! FFormEditor has no childsizing! Winni ---------------------------------------------------------------------- jamie · 2020-04-26 22:31 But its a TPanel he is doing this with.. and it has it.. I don't know ---------------------------------------------------------------------- wp · 2020-04-26 23:17 Do not align the children of the FCenterPanel to which you want to apply ChildSizing Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ...  FGroupBoxLazarus := TGroupBox.Create(FCenterPanel);  //FGroupBoxLazarus.Align := alClient;  // <--- REMOVED  FGroupBoxLazarus.Caption := 'Lazarus Palette';  FGroupBoxLazarus.Parent := FCenterPanel;   FGroupBoxComponent := TGroupBox.Create(FCenterPanel);  //FGroupBoxComponent.Align := alClient;   // < --- REMOVED  FGroupBoxComponent.Caption := 'Component Palette';  FGroupBoxComponent.Parent := FCenterPanel;  ... ---------------------------------------------------------------------- J-23 · 2020-04-27 00:15 Quote from: wp on April 27, 2020, 01:17:42 amDo not align the children of the FCenterPanel to which you want to apply ChildSizing Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ...  FGroupBoxLazarus := TGroupBox.Create(FCenterPanel);  //FGroupBoxLazarus.Align := alClient;  // <--- REMOVED  FGroupBoxLazarus.Caption := 'Lazarus Palette';  FGroupBoxLazarus.Parent := FCenterPanel;   FGroupBoxComponent := TGroupBox.Create(FCenterPanel);  //FGroupBoxComponent.Align := alClient;   // < --- REMOVED  FGroupBoxComponent.Caption := 'Component Palette';  FGroupBoxComponent.Parent := FCenterPanel;  ... That's right, thanks.