Unable to resize form by dragging its borders

Form autoload : False. AutoSizeMode form : grow and contract.

Problem: I can’t resize my form by dragging its borders, I can do this by dragging this handle on the bottom right of the form.

Is there any other property on the form that I decided to change to fix this problem?

It also shows a snapshot of the hierarchy of controls on the form ... maybe setting lower-level controls on the form causes this?

enter image description here

+4
source share
5 answers

Make sure FormBorderStyle is set to Sizable and the SizeGripStyle property is set to Auto or Hide.

+11
source

Because it is not in the answers, I will write here.

The problem seems to be related to the fact that the AutoSizeMode form is on GrowAndShrink and not GrowOnly, which is the default setting. Resetting to GrowOnly fixed the problem.

(confirmed in MSVS2013 with .net 4.5 on Win7)

+16
source

I have the same problem if the maximum size was set. Set it to 0 or more than now. After that, you can move the border wherever you want. Changing FormBorderStyle or SizeGripStyle cannot help if the maximum size is too small for the new settings.

+2
source
 int height = 960; int width = 1280; this.ClientSize = new System.Drawing.Size(width, height); 

this way you can get a fixed size of the form ... otherwise the visual studio will automatically change it

+1
source

I tried everything in the aforementioned (and Microsoft forums), could not get it to resize. Finally, just opened another instance with a form that I did not deceive and did not compare. Here is what you need to install. All of the above, but not as a combination.

In the form properties window (or in the code).

Autosize: False = allows you to resize both sizes (True = only with width settings).

AutosizeMode: GrowOnly = allows both to grow and shrink.

FormBorderStyle: size.

0
source

Source: https://habr.com/ru/post/1432551/


All Articles