Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I restrict or control the size of a form?

You can restrict the size of a form by setting it's MaximumSize and MinimumSize properties. This will help you control the maximum and minimum size the form can be resized to. Also note that WindowState property of the form plays a part in how the form can be resized.

// Minimum width = 300, Minimum height= 300 
this.MinimumSize = new Size(300, 300); 
 
//Maximum width = 800, Maximum height= unlimited 
this.MaximumSize = new Size(800, int.MaxValue); 

Contributed from George Shepherd's Windows Forms FAQ



Page view counter