0

I have a child form that's ManualDock'd onto a panel from a larger form.

The problem is that when calling ChildForm.Show(), the width of ChildForm is set to 1920 by the ShowWindow() function from user32.dll. How do I prevent this behavior? Even if this is the documented default Windows behavior, how come Delphi doesn't resize the form to the specifications of the properties?

This behavior occurs before docking. When docking the form seems to take the width of the parent it's docked on (here a simple panel) but this means that I cannot rely on the the width of the form being correct at all times.

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
muchos
  • 41
  • 5

1 Answers1

0

To limit the size of the dockable form, use its Constraints property:

  • Constraints.MaxHeight
  • Constraints.MaxWidth
  • Constraints.MinHeight
  • Constraints.MinWidth

With those set, you can rely on the size of the form to be as you specify.

Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54