System.Windows.Forms.ToolStripItem.Dock Property

Gets or sets which System.Windows.Forms.ToolStripItem borders are docked to its parent control and determines how a System.Windows.Forms.ToolStripItem is resized with its parent.

Syntax

[System.ComponentModel.DefaultValue(System.Windows.Forms.DockStyle.None)]
[System.ComponentModel.Browsable(false)]
public DockStyle Dock { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

This property applies only to flow layouts.

Use the ToolStripItem.Dock property to define how a System.Windows.Forms.ToolStripItem is automatically resized as its parent control is resized. For example, setting ToolStripItem.Dock to DockStyle.Left causes the System.Windows.Forms.ToolStripItem to align itself with the left edges of its parent control and to resize as the parent control is resized. Controls are docked in their Z-order, which is the visual layering of controls on a form along the form's Z-axis (depth).

A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container.

Note:

The ToolStripItem.Anchor and ToolStripItem.Dock properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0