Changes

Jump to: navigation, search

Designing Forms in Visual Studio

57 bytes added, 18:43, 20 July 2007
Anchoring and Autosizing Form Controls
All the controls we have worked with so far have been a fixed size. They have also remained that same size, even if the form in which they reside is resized. It is often useful to have a control resize when the form is resized. This is achieved using the ''Anchor'' property. To use this property, select a control in a form and click on the down arrow in the value field of the ''Anchor'' property in the Properties panel. A graphic will be displayed indicating the anchors currently set (typically the top and left edges of the control). Activate the anchors on the right and bottom edges of the control to anchor those sides:
[[Image:Examplvisual_studio_anchors.jpg| Setting Control Anchors in Visual Studio]]
Once the anchors are in place, press '''F5''' to compile und run the application. When the form is displayed and resized, the control with the anchors will grow in proportion to the size of the form.

Navigation menu