Unwanted form size growing when moving TSplitter when installing Panel1.Constraints.MinHeight

I have this type of situation (see image), now when I move Splitter1 up at runtime, the height of Panel2 increases and the height of Form1 increases.

But I need to know and block this type of event when Splitter1 cannot be moved due to Panel1.Constraints.MinHeight , therefore Panel2 cannot be changed its height and Form1 too.

Thanks for any help.

preview

- Change -
Panel1.Align : = alLeft;
Splitter1.Align : = alBottom,
Panel2.Align : = alBottom;

+6
source share
2 answers

You can check and reject further calibration in the CanResize splitter CanResize .

 procedure TForm1.Splitter1CanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); begin Accept := ClientHeight - (NewSize + Splitter1.Height) >= Panel1.Constraints.MinHeight; end; 
+6
source

Set the Splitter Splitter property to false and its MinSize property for MinHeight Panel1.

+1
source

Source: https://habr.com/ru/post/957221/


All Articles