Here are some frequently asked questions about Windows Forms and their answers.
- MinimumSize: the bare minimum size a control can be
set to
- MaximumSize: the maximum size a control can be set
to
- PreferredSize: the size a control prefers to be -
this is implemented by calling GetPreferredSize(0,0)
- AutoSize: Boolean specifying whether or not the
control should be set to it's preferred size
- public virtual Size GetPreferredSize(Size
constrainingSize) - This method returns the "preferredSize" of
the control given some size contstraints. If the size passed in is 0 in
any dimension or Int32.MaxValue, this implies that the size is not
constrained in that dimension.
- GetPreferredSize(0,0) Unconstrained in width,height
- GetPreferredSize(0,h) Constrained in height by
"h", unconstrained in width
- GetPreferredSize(w,0) Constrained in width by
"w", unconstrained in height
- GetPreferredSize(w,h) Constrained in width by
"w", constrained in height by "h"