System.Windows.Forms.ToolStrip.Dock Property

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

Syntax

[System.ComponentModel.DefaultValue(System.Windows.Forms.DockStyle.Top)]
public override DockStyle Dock { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the ToolStrip.Dock property to define how a System.Windows.Forms.ToolStrip is automatically resized as its parent control is resized. For example, setting ToolStrip.Dock to DockStyle.Left causes the System.Windows.Forms.ToolStrip 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.

If the System.Windows.Forms.ToolStrip control is in a System.Windows.Forms.ToolStripPanel, the System.Windows.Forms.ToolStrip can be repositioned within the System.Windows.Forms.ToolStripPanel and across System.Windows.Forms.ToolStripPanels. The ToolStrip.Dock property is ignored, and if the ToolStrip.Stretch property is false, the size of the System.Windows.Forms.ToolStrip grows as items are added to the System.Windows.Forms.ToolStripPanel. Typically, the System.Windows.Forms.ToolStrip does not participate in the tab order.

Note:

The ToolStrip.Anchor and ToolStrip.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