Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent a form from being resized by the user?

I have a form that needs to be maximized in VB.net. I don't want the user to be able to change its size or move it around. How can I do this?

like image 924
Alex Gordon Avatar asked Jul 13 '09 12:07

Alex Gordon


People also ask

How do you make a form not resizable?

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

How do I stop a form from resizing in VB net?

Answers. FormBorderStyle = FormBorderStyle. FixedSingle will prevent users from manually resizing the form. To prevent the form from being resized through code, handle the SizeChanged event and set the size back to the fixed size you want it to be.

How do you fix form size?

Right click on your form and go to properties. Then go to Layout options,see there are a property named Size. Change it as your need as width and length wise.


2 Answers

//Set fixed border yourForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D  //Set the state of your form to maximized        yourForm.WindowState = FormWindowState.Maximized  //Disable the minimize box and the maximize box yourForm.MinimizeBox = False yourForm.MaximizeBox = False 
like image 37
Francis B. Avatar answered Oct 13 '22 12:10

Francis B.


Set the highlighted properties. Set MaximimSize and MinimizeSize properties the same size

enter image description here

like image 111
Jim Lahman Avatar answered Oct 13 '22 10:10

Jim Lahman