Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

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

Windows Forms FAQs

How can I create a sizable autosized form?

If you set AutoSize = true for a form, the default setting for AutoSizeMode is GrowOnly.  This means an AutoSized dialog in this mode cannot snap back down to a smaller size.  Typically this is not what you want.  If you want a resizable dialog that can stop at the PreferredSize, use the MinimumSize property.

this.MinimumSize = this.PreferredSize

Alternately, if you do not want the dialog to be resizable, switch AutoSizeMode to GrowAndShrink.



Page view counter