Windows Develop Bookmark and Share   
 index > Windows Forms General > Locking Width of form from resizing
 

Locking Width of form from resizing

How do I lock the width of my form from being resized. I only want the length to be resizable.

Thanks.
knji  Saturday, April 28, 2007 4:41 AM
Set the form's MinimumSize and MaximumSize properties. For example:

private void Form1_Load(object sender, EventArgs e) {
this.MinimumSize = new Size(300, SystemInformation.CaptionHeight);
this.MaximumSize = new Size(300, Screen.PrimaryScreen.WorkingArea.Height);
}

nobugz  Saturday, April 28, 2007 6:04 AM
Set the form's MinimumSize and MaximumSize properties. For example:

private void Form1_Load(object sender, EventArgs e) {
this.MinimumSize = new Size(300, SystemInformation.CaptionHeight);
this.MaximumSize = new Size(300, Screen.PrimaryScreen.WorkingArea.Height);
}

nobugz  Saturday, April 28, 2007 6:04 AM
Thanks again.
knji  Saturday, April 28, 2007 8:10 PM

You can use google to search for other answers

Custom Search

More Threads

• User Controls with parametrized constructor
• Delete Text From PDF File Using VB.NET
• Problem with Working with Datagrid with custom fucntions
• Get a Listing Of Windows Application Forms.
• Binding a DropDownList
• DataGridView RowSelect and Delete
• Quick Brush Question
• three tier windows application
• How do I display specific columns from a BindingSource in a DataGridView?
• Animated gif in DataGridView