StatusStrip.Dock プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
親コントロールにドッキングする StatusStrip 罫線を取得または設定し、親コントロールで StatusStrip のサイズを変更する方法を決定します。
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
プロパティ値
DockStyle値の 1 つ。 既定値は、Bottom です。
例
次のコード例は、Dock プロパティなど、さまざまな共通プロパティが設定されたStatusStripを示しています。
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"
注釈
Dock プロパティを使用して、親コントロールのサイズを変更するStatusStripのサイズを自動的に変更する方法を定義します。 たとえば、 Dock を Left に設定すると、親コントロールの左端に合わせて StatusStrip が配置され、親コントロールのサイズが変更されるとサイズが変更されます。 コントロールは Z オーダーでドッキングされます。これは、フォームの Z 軸 (奥行き) に沿ってフォーム上のコントロールを視覚的にレイヤー化したものです。
コントロールは、親コンテナーの 1 つのエッジにドッキングすることも、すべてのエッジにドッキングして親コンテナーを埋めることもできます。