Live Chat Icon For mobile
Live Chat Icon

How can I restrict or control the size of my form?

Platform: WinForms| Category: 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.

[C#]
	//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);

[VB.NET]
	’Minimum width = 300, Minimum height= 300
	Me.MinimumSize = New Size(300, 300)
 
	’Maximum width = 800, Maximum height= unlimited
	Me.MaximumSize = New Size(800, Integer.MaxValue)

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.