Specifies how a control anchors to the edges of its container.
[Visual Basic] Public Enum AnchorStyles [C#] public enum AnchorStyles [C++] public enum AnchorStyles
[JScript] In JScript, you can use the enumerations in the NGWS frameworks, but you cannot define your own.
When a control is anchored to an edge of its container, the distance between the control and the specified edge remains constant when the container resizes. For example, if a control is anchored to the right edge of its container, the distance between the right edge of the control and the right edge of the container remains constant when the container resizes. A control can be anchored to any combination control edges. If the control is anchored to opposite edges of its container (for example, to the top and bottom), it resizes when the container resizes.
Member Name | Description |
---|---|
All | Each edge of the control anchors to the corresponding edge of its container. |
Bottom | The control is anchored to the bottom edge of its container. |
BottomLeft | The control is anchored to the bottom and left edges of its container. |
BottomLeftRight | The control is anchored to the bottom, left, and right edges of its container. |
BottomRight | The control is anchored to the bottom and right edges of its container. |
Left | The control is anchored to the left edge of its container. |
LeftRight | The control is anchored to the left and right edges of its container. |
None | The control is not anchored to any edges of its container. |
Right | The control is anchored to the right edge of its container. |
Top | The control is anchored to the top edge of its container. |
TopBottom | The control is anchored to the top and bottom edges of its container. |
TopBottomLeft | The control is anchored to the top, left, and bottom edges of its container. |
TopBottomRight | The control is anchored to the top, right, and bottom edges of its container. |
TopLeft | The control is anchored to the top and left edges of its container. |
TopLeftRight | The control is anchored to the left, top, and right edges of its container. |
TopRight | The control is anchored to the top and right edges of its container. |
Namespace: System.WinForms
Assembly: System.WinForms.dll