This code creates 2 panels with horizontal split:
procedure TForm1.Button1Click(Sender: TObject);
var
pnl: 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;