Purpose

Specifies how the control is anchored to its parent.


Description

Use Anchors to ensure that a control maintains its current position relative to an edge of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored.

The property is 4 switchable checkboxes: Left, Top, Right, Bottom.


By default, only Left and Top are set.

If a control is anchored to opposite edges of its parent, the control stretches when its parent is resized. For example, if a control has its Anchors property set to Left, Right, the control stretches when the width of its parent changes.