On a form, I have two large controls and a TSplitter
between them. The control on the top is aligned to the top and the control on the bottom is aligned to the client. So when I resize the form, the control on the top remains the same height while the one on the bottom varies. Then the splitter between them essentially controls the height of the control on the top.
However, when the form is resized to a smaller height than the top control, the bottom control becomes hidden. I've tried using the constraints to tweak how this reacts, but with no luck...
- When the splitter is resized, it shouldn't allow the user to drag it down any further than the bottom control's min height
- When the form is resized smaller than the bottom control allows, it should automatically resize the top control's height to allow the bottom control to fit
- When I set the bottom control's
MinHeight
constraint to, for example, 100, when resizing the splitter, it makes the form actually grow to fit the bottom control, rather than stopping the user from sizing any further. - When I set the splitter's
MinSize
property to, for example, 100, when resizing the splitter, I get very abnormal results (top control disappearing) and still hides the bottom control.
How do I make sure the bottom control is always visible when splitter or form are resizing without altering the size of the form?
DFM Code:
object Form1: TForm1
Left = 310
Top = 121
Caption = 'Form1'
ClientHeight = 374
ClientWidth = 434
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Splitter1: TSplitter
Left = 0
Top = 129
Width = 434
Height = 7
Cursor = crVSplit
Align = alTop
Beveled = True
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 434
Height = 129
Align = alTop
Caption = 'Panel1'
TabOrder = 0
ExplicitLeft = 48
ExplicitTop = 16
ExplicitWidth = 313
end
object Panel2: TPanel
Left = 0
Top = 136
Width = 434
Height = 238
Align = alClient
Caption = 'Panel2'
TabOrder = 1
ExplicitLeft = 16
ExplicitTop = 168
ExplicitWidth = 369
ExplicitHeight = 145
end
end