Reputation: 26929
Form's AutoSize: False. Form's AutoSizeMode: Grow and Shrink.
Issue: I cant resize my form by dragging its borders, I can only do that by dragging that grip thing on the bottom right side of the form.
Is there any other property on the form that I sohlud change to fix this problem?
Here is also a screen shot of the hierarchy of controls on the form...maybe setting on lower level controls on the form is causing this?
Upvotes: 21
Views: 41547
Reputation: 367
I finally figured out what was causing this for me. This had been a problem for years! None of the things listed here helped, and indeed, all of them were already set as suggested.
It turned out that I couldn't make a window smaller in width if any control was anchored to the right edge, or smaller in height if any control was anchored to the bottom edge.
Upvotes: 1
Reputation: 21
I have the same problem, I can not manually change the size of form or controls in manual mode. Tried all the above, checked prior forms in the project, I could resize them.
Then, closed VS 2010, reopened the project, and I can resize the form and controls ....
" Did you try the power switch ... ;)"
Upvotes: 2
Reputation: 617
Because this is not in the answers, I'll write this here.
The problem seems to be caused by the form's AutoSizeMode being on GrowAndShrink, and not GrowOnly, which is the default setting. Resetting to GrowOnly fixed the issue.
(confirmed on MSVS2013 with .net 4.5 on Win7)
Upvotes: 40
Reputation: 141
Tried everything in the above (and Microsoft's forums) couldn't get it to resize. Finally just opened another instance with a form I hadn't dorked up and compared. Here's what needed set. All are mentioned above but not as a combination.
In the form's property window (or in the code).
Autosize: False = allows resizing both dimensions (True = only width adjusted).
AutosizeMode: GrowOnly = allows both growing and shrinking.
FormBorderStyle: Sizeable.
Upvotes: 4
Reputation: 134
I have the same problem if maximum size was set. Please set it to 0
or to bigger than now. After that you can move the border wherever you want. Change FormBorderStyle
or SizeGripStyle
can't help if maximum size is too small to new settings.
Upvotes: 6
Reputation: 67
int height = 960;
int width = 1280;
this.ClientSize = new System.Drawing.Size(width, height);
this way you can get a fixed form size...otherwise visual studio automatically changes it
Upvotes: 1
Reputation: 71591
Make sure the FormBorderStyle is set to Sizable, and that the SizeGripStyle property is set to Auto or Hide.
Upvotes: 20