views:

230

answers:

3

C#:How can I fix a form size in win application and not to let user changes its size?

A: 

Oh I got it

By changing FormBorderStyle property of a form....

odiseh
+1  A: 

I'm pretty sure this isn't the BEST way, but you could set the Minimum and Maximim size properties to the same value. That will stop it.

pm_2
+3  A: 

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();
Pranay Rana