This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.
tlmddock horizontal split: How to set 2 panels to the same width?
This code creates 2 panels with horizontal split:
procedure TForm1.Button1Click(Sender: TObject);
varpnl: TLMDDockPanel;
begin
pnl := TLMDDockPanel.Create(Self);
pnl.Caption := 'My panel 1';
LMDDockSite1.DockControl(pnl, LMDDockSite1.SpaceZone, alClient);
pnl := TLMDDockPanel.Create(Self);
pnl.Caption := 'My panel 2';
LMDDockSite1.DockControl(pnl, LMDDockSite1.SpaceZone, alDocRight);
end;
But the right aligned panel has very small width. How to set both panels to the same width so that the splitter exactly tiles both panels to equal width?

Comments
var
pnl: TLMDDockPanel;
nWidth: Integer;
begin
pnl := TLMDDockPanel.Create(Self);
pnl.Caption := 'My panel 1';
LMDDockSite1.DockControl(pnl, LMDDockSite1.SpaceZone, alClient);
pnl := TLMDDockPanel.Create(Self);
pnl.Caption := 'My panel 2';
LMDDockSite1.DockControl(pnl, LMDDockSite1.SpaceZone, alDocRight);
nWidth:= ceil(LMDDockSite1.SpaceZone.Width / 2);
LMDDockSite1.SpaceZone.SetChildrenSizes([nWidth, nWidth]);
end;