|
Posted: Jul. 22, 2002

These three windows illustrate how Windows Forms can automatically
adjust as the size of the window is changed.
On the top is a simple form with fields for an employees first
and last name, a list of benefits the employee can select, and a button to update the
changes.
The middle example shows how this window would look if it were
resized without using Windows Forms automatic layout features (and is the same
behavior users would see if the application were created with previous versions of Visual
Basic). The window does become larger, but the additional space is useless because neither
the list box nor the name fields become any larger.
On the bottom is the same form using Windows Forms
automatic layout. In this case, resizing the form causes several changesthe field
for the employee last name becomes larger, allowing longer names to be fully visible; the
list box becomes larger, allowing more items to be seen; and the Update button moves to
the lower right corner. The developer achieves this effect by setting a few properties on
the controlsno custom code needs to be written.
|