So, I am creating a form layout and trying to set a minimum size for it to find out that WinForms has a fit! So, this is what it looks like when I start with the MinimumSize property set ONLY for width ...

As you can see, it looks great, without extra spaces, the form is the size I want, etc. .... Then I try to close the form and open it back, I have a little oddity (MinimumSize height was set equal to 0, and now WinForms made it 38), but everything that it worked as expected.

It's nice that the odd value of โ38โ in MinimumSize-Height is strange, but whatever, let me try to set my preferred MinimumSize-Height to 420 (same size as the shape).

Save, close the form designer and open ... WTF? Everything went wrong! My three buttons below were pushed upward, so the text box and the TreeView control that I have above it, as well as the height of the left list, are reduced. In fact, looking at him, it seems that all the controls are still correct. The changed variable is the size of the form. It somehow went from 420 to 442.

Does anyone know why this is happening? What can I do to fix this, or do I think I get around this? Keep in mind that I have buttons, and the text box is pinned to the bottom. Tree formation should remain attached to the top and grow with the size of the window.
Thanks!
source share