System.Windows.Forms.DockStyle Enumeration

Specifies the position and manner in which a control is docked.

Syntax

[System.ComponentModel.Editor("System.Windows.Forms.Design.DockEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public enum DockStyle

Remarks

When a control is docked to an edge of its container, it is always positioned flush against that edge when the container is resized. If more than one control is docked to an edge, the controls appear side by side according to their z-order; controls higher in the z-order are positioned farther from the container's edge.

If DockStyle.Left, DockStyle.Right, DockStyle.Top, or DockStyle.Bottom is selected, the specified and opposite edges of the control are resized to the size of the containing control's corresponding edges. If DockStyle.Fill is selected, all four sides of the control are resized to match the containing control's edges.

Members

Member NameDescription
Bottom

The control's bottom edge is docked to the bottom of its containing control.

Fill

All the control's edges are docked to the all edges of its containing control and sized appropriately.

Left

The control's left edge is docked to the left edge of its containing control.

None

The control is not docked.

Right

The control's right edge is docked to the right edge of its containing control.

Top

The control's top edge is docked to the top of its containing control.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0