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?
to make a form not resizable just change the property: FormBorderStyle to anything but not Resizable.
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.
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.
//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
Set the highlighted properties. Set MaximimSize and MinimizeSize properties the same size
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With