Name
AnchorStyles
Synopsis
This is used by Control objects to suggest to
layout managers how they should be treated. The default layout
manager first looks at Control.Dock on each
contained object to see if it should be locked to one edge or another
(see DockStyle). If it is not docked, it then
examines the Control.Anchor property.
If a Control is anchored to a particular edge, it
means that the side nearest to that edge will be maintained at a
fixed distance from it. You can anchor to more than one edge,
allowing you to create controls that move or resize as their
container is resized.
You can replace the default layout management by overriding the
OnLayout() method. You might do this in
conjunction with a
System.ComponentModel.IExtenderProvider that adds
additional properties to the contained Control
objects to help manage the new layout mechanism.
public enum AnchorStyles { None = 0x00000000, Top = 0x00000001, Bottom = 0x00000002, Left = 0x00000004, Right = 0x00000008 }
Hierarchy
System.Object
→ System.ValueType → System.Enum(System.IComparabl,
System.IFormattable,
System.IConvertible)
→ AnchorStyles
Returned By
Control.Anchor
Passed To
Control.Anchor
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access