30

User can change form size. I do not find a property of form that do not allow user to change form size.

bluish
  • 26,356
  • 27
  • 122
  • 180
Mary
  • 581
  • 4
  • 8
  • 16
  • Does this answer your question? [How do I prevent a form from being resized by the user?](https://stackoverflow.com/questions/1119256/how-do-i-prevent-a-form-from-being-resized-by-the-user) – rold2007 Dec 08 '21 at 05:54

11 Answers11

41

Change FormBorderStyle to FixedDialog, FixedSingle, or Fixed3D. Also, if you do not want them to maximize the form set Maximize to False.

bluish
  • 26,356
  • 27
  • 122
  • 180
novacara
  • 2,207
  • 4
  • 24
  • 34
39

Set the FormBorderStyle to another value like FixedSingle or FixedDialog.

bluish
  • 26,356
  • 27
  • 122
  • 180
ZippyV
  • 12,540
  • 3
  • 37
  • 52
9

There are a few of workarounds for this:

  1. Set maximum size property to a value you prefer. If you do not want the application window to be shrunk as well, then set a minimum size property. If you prefer the application to have the exact same size as that of design time, then set both maximum size and minimum size as size of your window. (Once you set maximum size or minimum size from the designer, you can't resize your window programmatically, unless you re-set maximum size and minimum size programmatically again)

  2. Set FormBorderStyle to FixedSingle or FixedDialog. The difference in looks wont be noticeable for untrained eyes, but one considerable difference I'd found from my experience is that, when you make it FixedSingle, you can still change the size programmatically. With FixedDialog its not possible. That's a huge advantage for FixedSingle property. (If you want to change size of your window programmatically here after going for FixedDialog, then you got to programmatically change FormBorderStyle first, which would create a slight blink effect when running the application).

So simply go for FixedSingle. And to make sense, do the following:

a. Set maximize box property to false.

b. Set SizeGripStyle to Hide.

nawfal
  • 70,104
  • 56
  • 326
  • 368
6

Change the BorderStyle to be one of the "Fixed" styles and remove the maximize button.

Aric TenEyck
  • 8,002
  • 1
  • 34
  • 48
5

From the Form Properties Window set:
1. FormBorderStyle -> FixedSingle.
2. MaximizeBox -> False.

Bassem
  • 820
  • 9
  • 17
4

Change the FormBorderStyle to Fixed*.

Adrian Godong
  • 8,802
  • 8
  • 40
  • 62
2

You can change the border style to :

BorderStyle - fixedToolWindow

But you will loose the maximize and minimize buttons, custom buttons will be needed if you require those functionalities.

Philo
  • 1,931
  • 12
  • 39
  • 77
1

Set the min and max size to the same value.

Ed S.
  • 122,712
  • 22
  • 185
  • 265
1

The form has MinimumSize and MaximumSize properties that you can set to control this. You might use this if you want to keep the standard form border.

Chris Dunaway
  • 10,974
  • 4
  • 36
  • 48
0

Just add this 2 lines of C# code for your form (inside InitializeComponent() function):

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.ImeMode = System.Windows.Forms.ImeMode.NoControl;

Tested with Visual Studio 2017 with .NET 4.6.1

zdarova
  • 97
  • 5
0

For each form, there is a Maximize Box option. Please set it to false to avoid resize. See example here:

example image

Draken
  • 3,134
  • 13
  • 34
  • 54
Anbin Anil
  • 11
  • 2