I have a form with two panels separated by a splitterbar.
In the code below, EntryPanel is leftmost, and aligned left.
Then comes AdvSplitter1, also aligned left.
Finally InfoPanel, which is aligned client.
ClientBorder is an integer calculated on formcreate, in case the amount of pixels in the client border changes with users' Windows settings. It's calculated by a simple sum.
EntryPanel has a minimum width constraint set, so it can't be made smaller than the space required to dispay its edit boxes.
What I'm trying to do below is keep the width of InfoPanel constant, and therefore move position of AdvSplitter1 relative to the form right side, until EntryPanel width hits the minimum constraint.
What actually happens is as soon as you start resizing the form EntryPanel snaps to the position of it's minimum constraint and stays fixed, with AdvSplitter1 moving up against it as it should, then InfoPanel resizes accordingly as you resize the form.
I can't see why this should happen?
Code:
procedure TMainForm.FormResize(Sender: TObject);
begin
InfoPanel.Left := MainForm.ClientWidth - InfoPanel.Width - ClientBorder;
AdvSplitter1.Left := InfoPanel.Left - 6;
EntryPanel.Width := MainForm.ClientWidth - AdvSplitter1.Left - ClientBorder;
end;
Steve (Delphi 2007 & XP)