Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix the form size in a C# Windows Forms application and not to let user change its size?

How can I fix the form size in a C# Windows Forms application and not to let user change its size?

like image 512
odiseh Avatar asked May 26 '10 06:05

odiseh


People also ask

How do you fix form size?

Solution 3Right 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. Also see a property named StartPosition just after the Size property.

How do you set a form size?

By dragging either the right edge, bottom edge, or the corner, you can resize the form. The second way you can resize the form while the designer is open, is through the properties pane. Select the form, then find the Properties pane in Visual Studio. Scroll down to size and expand it.

How do I fit windows form to any resolution?

simply set Autoscroll = true for ur windows form..


1 Answers

Check this:

// Define the border style of the form to a dialog box. form1.FormBorderStyle = FormBorderStyle.FixedDialog;  // Set the MaximizeBox to false to remove the maximize box. form1.MaximizeBox = false;  // Set the MinimizeBox to false to remove the minimize box. form1.MinimizeBox = false;  // Set the start position of the form to the center of the screen. form1.StartPosition = FormStartPosition.CenterScreen;  // Display the form as a modal dialog box. form1.ShowDialog(); 
like image 178
Pranay Rana Avatar answered Sep 23 '22 19:09

Pranay Rana