When my WinForm loads it is always a lot smaller than what I set it to in the builder. For example, I set the size as 2169, 1398, yet it comes up MUCH MUCH smaller than what I wanted. Any answers or suggestions?
Asked
Active
Viewed 382 times
1
-
Can you post some more info? I'd check your properties to see if AutoSize is set to true, and if so check to ensure GrowAndShrink is not selected. Please post what those are. – Bud Jameson Aug 04 '17 at 17:50
-
Need more info, but specifically, where are you setting the size? – Capn Jack Aug 04 '17 at 17:51
-
Auto Size is set to true, and GrowAndShrink false. I have a simple Form1 with the size set to 2169, 1398 and it comes up like a 500,500 for me – Luke Erickson Aug 04 '17 at 17:55
-
@LukeErickson Does that mean that `AutoSizeMode` is set to `GrowOnly`? – Bud Jameson Aug 04 '17 at 17:57
-
@CapnJack No. There is `AutoSizeMode` which is taken into consideration if `AutoSize` is `True`. `AutoSizeMode` can be set to `GrowOnly` or `GrowAndShrink`. – Bud Jameson Aug 04 '17 at 18:01
-
@BudJameson True, my bad. – Capn Jack Aug 04 '17 at 18:06
-
@CapnJack No Worries man, just wanted to make sure false information wasn't spread. I imagine simply changing `AutoSize` to false solved to OPs problem. However, kudos on the form_load event as a fallback. – Bud Jameson Aug 04 '17 at 18:19
1 Answers
1
When specifying the size of your winform it's highly recommended to save the dimenions in a settings
file. Then on your form_load
event specify your width and height to the values saved in your settings.
A really good guide on how to do this can be found here
I should also mention that you're going to want to set form1.AutoSize = false
to prevent it from changing on you.

Capn Jack
- 1,201
- 11
- 28