2

Is there a built-in option to preserve a form's width (or height) when resizing it, so you could only change the height (or width) of the form in WinForms? I'm not looking for a custom code solution, only options via Property toolbar.

user1306322
  • 8,561
  • 18
  • 61
  • 122
  • I'm looking for a built-in option. If it doesn't exist, I could come up with a custom solution. – user1306322 Sep 08 '13 at 11:49
  • @HansPassant nope. Not looking for code here, only built-in Properties in Property toolbar. – user1306322 Sep 08 '13 at 12:08
  • That comment clearly wasn't meant for you, it was meant for the legion of googlers that find this question some day and don't want to confuse their users like you do :) – Hans Passant Sep 08 '13 at 12:20
  • Almost any property of a window can be accessed both by code and through the properties window. In any case, setting in the properties window still sets it in code (albeit in the designer.cs file)! The solutions in the other answer seem perfectly valid if your only complaint is "I don't want to use code". – BradleyDotNET Apr 06 '14 at 02:41

1 Answers1

4

E.g. for a fixed height of 500px:
You can set the Form's MinimumSize to 0;500 and MaximumSize to 5000;500.

KekuSemau
  • 6,830
  • 4
  • 24
  • 34