Anchor Property Winforms Quick Tuts


Using Anchor Property

Most new desktop application developers and designers missed to use the anchor property. Anchor property is very useful to make your desktop applications more responsive when screen size changes or when you resize a particular form. Anchor can save your application design from having an unpredictable interface by tying controls to certain position on its parent form.

Use the Anchor property to define how a control is automatically resized as its parent control is resized. Anchoring a control to its parent control ensures that the anchored edges remain in the same position relative to the edges of the parent control when the parent control is resized.
Microsoft

The default anchor setting for a control when placed on a form in Visual Studio is “Top, Left”.  This make the control stays on the location with respect to the top and left edges of the form.

The following are the fouravailable values for Anchor Property. This property can be turned on or off:using-anchor-property-01

Top — Indicates that the control should keep its top edge stationary in respect to the parent form (or control) top edge.
Bottom — Indicates that the control should keep its bottom edge stationary in respect to the parent form (or control) bottom edge.
Left — Indicates that the control should keep its left edge stationary in respect to the parent form (or control) left edge.
Right — Indicates that the control should keep its right edge stationary in respect to the parent form (or control) right edge.

Liked it? Take a second to support denricdenise on Patreon!

You may also like...