Align ist bei Panel1 und 2 alNone.
Bei Panel0 (MotherPanel) AlClient oder AlTop.
PanelWidth nach Bedarf anpassen.
Die Prozedur im FormShow UND FormResize aufrufen.
Code:
procedure TForm1.SizeMe(Sender: TObject);
const
PanelWidth = 500; (* The required width for each client panel *)
begin
Panel1.Width := PanelWidth;
Panel2.Width := PanelWidth;
if Panel0.Width <= 2*PanelWidth then begin
Panel1.Top := 0;
Panel2.Top := (Panel0.Height div 2) +1;
Panel1.Left := 0;
Panel2.Left := 0;
Panel1.Height := Panel0.Height div 2;
Panel2.Height := Panel0.Height div 2;
end
else begin
Panel1.Top := 0;
Panel2.Top := 0;
Panel1.Left := 0;
Panel2.Left := PanelWidth + 1;
Panel1.Height := Panel0.Height;
Panel2.Height := Panel0.Height;
end;
Make me a sandwich! - What? Make it yourself. - Sudo make me a sandwich! - Okay