SplitContainer.Dock プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

/** @property */ public DockStyle get_Dock () /** @property */ public void set_Dock (DockStyle value)
DockStyle 値の 1 つ。既定値は None です。

SplitContainer をコンテナの任意の端にドッキングしたり、SplitContainer をコンテナのすべての端にドッキングして SplitContainer をコンテナ全体に表示したりできます。たとえば、このプロパティを DockStyle.Left に設定すると、SplitContainer の左端がコンテナの左端に結合されます。コントロールは z オーダーに基づいてドッキングされます。
![]() |
---|
z オーダーは画面の深度に対応し、x オーダーと y オーダーはそれぞれ横の寸法と縦の寸法に対応します。z オーダーは、コントロールまたはウィンドウが画面上で重なったり、同じ領域に配置されたりする可能性がある場合に、オブジェクトの重なりの順序を定義します。z オーダーの一番上にあるコントロールやウィンドウは、他のすべてのコントロールやウィンドウの上に表示され、Controls プロパティにおいてインデックス 0 で参照されます。z オーダーの一番下にあるコントロールやウィンドウは、他のすべてのコントロールやウィンドウの下に表示され、Controls プロパティにおいてインデックス (Controls.Count-1) で参照されます。 |
コントロールの固定およびドッキングの詳細については、「方法 : Windows フォームでマルチペイン ユーザー インターフェイスを作成する」を参照してください。

次のコード例では、Dock プロパティが Fill に設定された垂直方向の分割線を示します。また、垂直方向の分割線の他の基本的なプロパティも示します。このコード例は、SplitContainer クラスのトピックで取り上げているコード例の一部分です。
' Basic SplitContainer properties. ' This is a vertical splitter that moves in 10-pixel increments. ' This splitter needs no explicit Orientation property because Vertical is the default. splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill splitContainer1.ForeColor = System.Drawing.SystemColors.Control splitContainer1.Location = New System.Drawing.Point(0, 0) splitContainer1.Name = "splitContainer1" ' You can drag the splitter no nearer than 30 pixels from the left edge of the container. splitContainer1.Panel1MinSize = 30 ' You can drag the splitter no nearer than 20 pixels from the right edge of the container. splitContainer1.Panel2MinSize = 20 splitContainer1.Size = New System.Drawing.Size(292, 273) splitContainer1.SplitterDistance = 79 ' This splitter moves in 10-pixel increments. splitContainer1.SplitterIncrement = 10 splitContainer1.SplitterWidth = 6 ' splitContainer1 is the first control in the tab order. splitContainer1.TabIndex = 0 splitContainer1.Text = "splitContainer1" ' Add a TreeView control to the left panel. splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control ' Add a TreeView control to Panel1. splitContainer1.Panel1.Controls.Add(treeView1) splitContainer1.Panel1.Name = "splitterPanel1" ' Controls placed on Panel1 support right-to-left fonts. splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes
// Basic SplitContainer properties. // This is a vertical splitter that moves in 10-pixel increments. // This splitter needs no explicit Orientation property because Vertical is the default. splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; splitContainer1.ForeColor = System.Drawing.SystemColors.Control; splitContainer1.Location = new System.Drawing.Point(0, 0); splitContainer1.Name = "splitContainer1"; // You can drag the splitter no nearer than 30 pixels from the left edge of the container. splitContainer1.Panel1MinSize = 30; // You can drag the splitter no nearer than 20 pixels from the right edge of the container. splitContainer1.Panel2MinSize = 20; splitContainer1.Size = new System.Drawing.Size(292, 273); splitContainer1.SplitterDistance = 79; // This splitter moves in 10-pixel increments. splitContainer1.SplitterIncrement = 10; splitContainer1.SplitterWidth = 6; // splitContainer1 is the first control in the tab order. splitContainer1.TabIndex = 0; splitContainer1.Text = "splitContainer1"; // When the splitter moves, the cursor changes shape. splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(splitContainer1_SplitterMoved); splitContainer1.SplitterMoving += new System.Windows.Forms.SplitterCancelEventHandler(splitContainer1_SplitterMoving); // Add a TreeView control to the left panel. splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control; // Add a TreeView control to Panel1. splitContainer1.Panel1.Controls.Add(treeView1); splitContainer1.Panel1.Name = "splitterPanel1"; // Controls placed on Panel1 support right-to-left fonts. splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
// Basic SplitContainer properties. // This is a vertical splitter that moves in 10-pixel increments. // This splitter needs no explicit Orientation property because Vertical is the default. splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill; splitContainer1->ForeColor = System::Drawing::SystemColors::Control; splitContainer1->Location = System::Drawing::Point( 0, 0 ); splitContainer1->Name = "splitContainer1"; // You can drag the splitter no nearer than 30 pixels from the left edge of the container. splitContainer1->Panel1MinSize = 30; // You can drag the splitter no nearer than 20 pixels from the right edge of the container. splitContainer1->Panel2MinSize = 20; splitContainer1->Size = System::Drawing::Size( 292, 273 ); splitContainer1->SplitterDistance = 79; // This splitter moves in 10-pixel increments. splitContainer1->SplitterIncrement = 10; splitContainer1->SplitterWidth = 6; // splitContainer1 is the first control in the tab order. splitContainer1->TabIndex = 0; splitContainer1->Text = "splitContainer1"; // When the splitter moves, the cursor changes shape. splitContainer1->SplitterMoved += gcnew System::Windows::Forms::SplitterEventHandler( this, &Form1::splitContainer1_SplitterMoved ); splitContainer1->SplitterMoving += gcnew System::Windows::Forms::SplitterCancelEventHandler( this, &Form1::splitContainer1_SplitterMoving ); // Add a TreeView control to the left panel. splitContainer1->Panel1->BackColor = System::Drawing::SystemColors::Control; // Add a TreeView control to Panel1. splitContainer1->Panel1->Controls->Add( treeView1 ); splitContainer1->Panel1->Name = "splitterPanel1"; // Controls placed on Panel1 support right-to-left fonts. splitContainer1->Panel1->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
// Basic SplitContainer properties. // This is a vertical splitter that moves in 10-pixel increments. // This splitter needs no explicit Orientation property because // Vertical is the default. splitContainer1.set_Dock(System.Windows.Forms.DockStyle.Fill); splitContainer1.set_ForeColor(System.Drawing.SystemColors.get_Control()); splitContainer1.set_Location(new System.Drawing.Point(0, 0)); splitContainer1.set_Name("splitContainer1"); // You can drag the splitter no nearer than 30 pixels from the // left edge of the container. splitContainer1.set_Panel1MinSize(30); // You can drag the splitter no nearer than 20 pixels from the // right edge of the container. splitContainer1.set_Panel2MinSize(20); splitContainer1.set_Size(new System.Drawing.Size(292, 273)); splitContainer1.set_SplitterDistance(79); // This splitter moves in 10-pixel increments. splitContainer1.set_SplitterIncrement(10); splitContainer1.set_SplitterWidth(6); // splitContainer1 is the first control in the tab order. splitContainer1.set_TabIndex(0); splitContainer1.set_Text("splitContainer1"); // When the splitter moves, the cursor changes shape. splitContainer1.add_SplitterMoved(new System.Windows.Forms. SplitterEventHandler(splitContainer1_SplitterMoved)); splitContainer1.add_SplitterMoving(new System.Windows.Forms. SplitterCancelEventHandler(splitContainer1_SplitterMoving)); // Add a TreeView control to the left panel. splitContainer1.get_Panel1().set_BackColor(System.Drawing.SystemColors. get_Control()); // Add a TreeView control to Panel1. splitContainer1.get_Panel1().get_Controls().Add(treeView1); splitContainer1.get_Panel1().set_Name("splitterPanel1"); // Controls placed on Panel1 support right-to-left fonts. splitContainer1.get_Panel1().set_RightToLeft(System.Windows.Forms. RightToLeft.Yes);

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SplitContainer クラス
SplitContainer メンバ
System.Windows.Forms 名前空間
DockStyle 列挙体
その他の技術情報
方法 : Windows フォームでマルチペイン ユーザー インターフェイスを作成する
Weblioに収録されているすべての辞書からSplitContainer.Dock プロパティを検索する場合は、下記のリンクをクリックしてください。

- SplitContainer.Dock プロパティのページへのリンク