StatusStrip.Dock Egenskap

Definition

Hämtar eller anger vilka kantlinjer som StatusStrip dockas till den överordnade kontrollen och avgör hur en StatusStrip storleksändras med dess överordnade.

public:
 virtual property System::Windows::Forms::DockStyle Dock { System::Windows::Forms::DockStyle get(); void set(System::Windows::Forms::DockStyle value); };
public override System.Windows.Forms.DockStyle Dock { get; set; }
member this.Dock : System.Windows.Forms.DockStyle with get, set
Public Overrides Property Dock As DockStyle

Egenskapsvärde

Ett av DockStyle värdena. Standardvärdet är Bottom.

Exempel

I följande kodexempel visas en StatusStrip med olika vanliga egenskapsuppsättningar, inklusive egenskapen Dock .

statusStrip1.Dock = System.Windows.Forms.DockStyle.Top;
statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible;
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
toolStripStatusLabel1});
statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
statusStrip1.Location = new System.Drawing.Point(0, 0);
statusStrip1.Name = "statusStrip1";
statusStrip1.ShowItemToolTips = true;
statusStrip1.Size = new System.Drawing.Size(292, 22);
statusStrip1.SizingGrip = false;
statusStrip1.Stretch = false;
statusStrip1.TabIndex = 0;
statusStrip1.Text = "statusStrip1";
statusStrip1.Dock = System.Windows.Forms.DockStyle.Top
statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible
statusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {toolStripStatusLabel1})
statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow
statusStrip1.Location = New System.Drawing.Point(0, 0)
statusStrip1.Name = "statusStrip1"
statusStrip1.ShowItemToolTips = True
statusStrip1.Size = New System.Drawing.Size(292, 22)
statusStrip1.SizingGrip = False
statusStrip1.Stretch = False
statusStrip1.TabIndex = 0
statusStrip1.Text = "statusStrip1"

Kommentarer

Använd egenskapen Dock för att definiera hur en StatusStrip automatiskt ändras när dess överordnade kontroll ändras. Om du till exempel anger Dock att LeftStatusStrip den ska justera sig mot den överordnade kontrollens vänstra kanter och ändra storlek när den överordnade kontrollen ändras. Kontrollerna dockas i sin Z-ordning, vilket är den visuella skiktningen av kontroller i ett formulär längs formulärets Z-axel (djup).

En kontroll kan dockas till en kant av den överordnade containern eller dockas till alla kanter och fylla den överordnade containern.

Gäller för