ToolStripItem.Anchor ToolStripItem.Anchor ToolStripItem.Anchor ToolStripItem.Anchor Property

定义

获取或设置 ToolStripItem 要绑定到的容器的边缘,并确定 ToolStripItem 如何随其父级调整大小。Gets or sets the edges of the container to which a ToolStripItem is bound and determines how a ToolStripItem is resized with its parent.

public:
 property System::Windows::Forms::AnchorStyles Anchor { System::Windows::Forms::AnchorStyles get(); void set(System::Windows::Forms::AnchorStyles value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.AnchorStyles Anchor { get; set; }
member this.Anchor : System.Windows.Forms.AnchorStyles with get, set
Public Property Anchor As AnchorStyles

属性值

异常

注解

使用属性可定义自动调整的ToolStripItem大小, 因为其父控件调整大小。 AnchorUse the Anchor property to define how a ToolStripItem 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.

备注

AnchorDock属性是互相排斥。The Anchor and Dock properties are mutually exclusive. 一次只能设置一个, 而最后一个集则优先。Only one can be set at a time, and the last one set takes precedence.

适用于