Craig Johnston
Craig Johnston

Reputation: 7607

C#: making a form non-resizable

In order to make a form non-resizable I have set MaximumSize and MinimumSize to the same value.

The problem I have is that when the user points to the border of the form, the mouse pointer changes so that it look as though the form is resizable. Is is possible for this not to happen?

Upvotes: 43

Views: 86517

Answers (8)

Kram
Kram

Reputation: 163

If you desire to set this in designer under Appearance there is a field to set FormBorderStyle this can be changed to something that starts out with Fixed*.

Upvotes: 2

xXEmeraldPlayzXx
xXEmeraldPlayzXx

Reputation: 31

Just go under misc and change sizeable to false.

Upvotes: 1

yelliver
yelliver

Reputation: 5936

"Set Form.FormBorderStyle to something else than Sizable" is not enough, need to set MaximizeBox = False, or user can change form size by maximum it

Upvotes: 4

Richmonde Calalo
Richmonde Calalo

Reputation: 21

formName.FormBorderStyle = FormBorderStyle.FixedSingle; 

Upvotes: 0

Andrey
Andrey

Reputation: 6204

[...] FormBorderStyle.FixedDialog border style changes the border of the form to that of a dialog box and prevents the form from being resized. [...]

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.formborderstyle.aspx

Upvotes: 2

Davide Piras
Davide Piras

Reputation: 44605

to make a form not resizable just change the property: FormBorderStyle to anything but not Resizable.

Upvotes: 1

TurBas
TurBas

Reputation: 1676

Use this:

this.FormBorderStyle = FormBorderStyle.FixedSingle; 

Upvotes: 32

Christian Hayter
Christian Hayter

Reputation: 31071

Set Form.FormBorderStyle to something else than Sizable.

Upvotes: 85

Related Questions