SplitContainer クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

<ComVisibleAttribute(True)> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ Public Class SplitContainer Inherits ContainerControl
[ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] public class SplitContainer : ContainerControl
[ComVisibleAttribute(true)] [ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] public ref class SplitContainer : public ContainerControl
/** @attribute ComVisibleAttribute(true) */ /** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ public class SplitContainer extends ContainerControl
ComVisibleAttribute(true) ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) public class SplitContainer extends ContainerControl

2 つのサイズ変更可能なパネルにコントロールを追加したり、既存の SplitContainer パネルに別の SplitContainer コントロールを追加して、多くのサイズ変更可能な表示領域を作成したりできます。
SplitContainer コントロールを使用すると、コンテナ (Form など) の表示領域を分割し、ユーザーが SplitContainer パネルに追加されるコントロールのサイズを変更できるようになります。ユーザーが分割線上にマウス ポインタを通過させると、カーソルが変化し、SplitContainer コントロール内のコントロールのサイズを変更できることが示されます。
![]() |
---|
また SplitContainer により、デザイン時のコントロールの配置が容易になります。たとえば、Windows エクスプローラに類似したウィンドウを作成するには、SplitContainer コントロールを Form に追加し、その Dock プロパティを DockStyle.Fill に設定します。次に、TreeView コントロールを Form に追加し、その Dock プロパティを DockStyle.Fill に設定します。ListView コントロールを追加し、その Dock プロパティを DockStyle.Fill に設定して、Form 上の残りの領域いっぱいに ListView を表示し、レイアウトを完成させます。これで、実行時にユーザーが分割線を使用して両方のコントロールの幅を変更できるようになります。FixedPanel プロパティを使用すると、Form やその他のコンテナに合わせてコントロールをサイズ変更しないよう指定できます。
SplitterDistance を使用すると、フォーム上の分割線の開始位置を指定できます。また、SplitterIncrement を使用すると、分割線が一度に移動するピクセル数を指定できます。SplitterIncrement の既定値は 1 ピクセルです。
Panel1MinSize および Panel2MinSize を使用すると、分割線と SplitContainer パネルの外端との最短距離を指定できます。パネルの既定の最小サイズは 25 ピクセルです。
Orientation プロパティを使用すると、平面上の方向を指定できます。SplitContainer の既定の方向は垂直です。
BorderStyle プロパティを使用すると、SplitContainer の境界線スタイルを指定して、SplitContainer に追加するコントロールの境界線スタイルと連動させることができます。

次のコード例は、垂直方向と水平方向の両方の SplitContainer を示しています。垂直方向の分割線は、10 ピクセル単位で移動します。垂直方向の SplitContainer の左側パネルには TreeView コントロールが配置され、右側パネルには水平方向の SplitContainer が配置されています。水平方向の SplitContainer の両側にあるパネルには、ListView コントロールがいっぱいに表示されています。上側パネルは FixedPanel として定義されているため、コンテナをサイズ変更してもサイズ変更されません。垂直方向の分割線を移動すると SplitterMoving イベントが発生します。この例では、カーソル スタイルの変更によって、このイベントの発生が通知されます。分割線の移動が中止されると、SplitterMoved イベントが発生します。この例では、カーソル スタイルが既定のスタイルに戻ることによって、このイベントの発生が通知されます。
' Compile this example using the following command line: ' vbc basicsplitcontainer.vb /r:System.Drawing.dll /r:System.Windows.Forms.dll /r:System.dll /r:System.Data.dll Imports System Imports System.Drawing Imports System.Collections Imports System.ComponentModel Imports System.Windows.Forms Imports System.Data Imports Microsoft.VisualBasic Public Class Form1 Inherits System.Windows.Forms.Form Private WithEvents splitContainer1 As System.Windows.Forms.SplitContainer Private treeView1 As System.Windows.Forms.TreeView Private splitContainer2 As System.Windows.Forms.SplitContainer Private listView2 As System.Windows.Forms.ListView Private listView1 As System.Windows.Forms.ListView Public Sub New() InitializeComponent() End Sub 'New Private Sub InitializeComponent() splitContainer1 = New System.Windows.Forms.SplitContainer() treeView1 = New System.Windows.Forms.TreeView() splitContainer2 = New System.Windows.Forms.SplitContainer() listView1 = New System.Windows.Forms.ListView() listView2 = New System.Windows.Forms.ListView() splitContainer1.SuspendLayout() splitContainer2.SuspendLayout() SuspendLayout() ' 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 ' Add a SplitContainer to the right panel. splitContainer1.Panel2.Controls.Add(splitContainer2) splitContainer1.Panel2.Name = "splitterPanel2" ' This TreeView control is in Panel1 of splitContainer1. treeView1.Dock = System.Windows.Forms.DockStyle.Fill treeView1.ForeColor = System.Drawing.SystemColors.InfoText treeView1.ImageIndex = - 1 treeView1.Location = New System.Drawing.Point(0, 0) treeView1.Name = "treeView1" treeView1.SelectedImageIndex = - 1 treeView1.Size = New System.Drawing.Size(79, 273) ' treeView1 is the second control in the tab order. treeView1.TabIndex = 1 ' Basic SplitContainer properties. ' This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed. splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill ' The top panel remains the same size when the form is resized. splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1 splitContainer2.Location = New System.Drawing.Point(0, 0) splitContainer2.Name = "splitContainer2" ' Create the horizontal splitter. splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal splitContainer2.Size = New System.Drawing.Size(207, 273) splitContainer2.SplitterDistance = 125 splitContainer2.SplitterWidth = 6 ' splitContainer2 is the third control in the tab order. splitContainer2.TabIndex = 2 splitContainer2.Text = "splitContainer2" ' This splitter panel contains the top ListView control. splitContainer2.Panel1.Controls.Add(listView1) splitContainer2.Panel1.Name = "splitterPanel3" ' This splitter panel contains the bottom ListView control. splitContainer2.Panel2.Controls.Add(listView2) splitContainer2.Panel2.Name = "splitterPanel4" ' This ListView control is in the top panel of splitContainer2. listView1.Dock = System.Windows.Forms.DockStyle.Fill listView1.Location = New System.Drawing.Point(0, 0) listView1.Name = "listView1" listView1.Size = New System.Drawing.Size(207, 125) ' listView1 is the fourth control in the tab order. listView1.TabIndex = 3 ' This ListView control is in the bottom panel of splitContainer2. listView2.Dock = System.Windows.Forms.DockStyle.Fill listView2.Location = New System.Drawing.Point(0, 0) listView2.Name = "listView2" listView2.Size = New System.Drawing.Size(207, 142) ' listView2 is the fifth control in the tab order. listView2.TabIndex = 4 ' These are basic properties of the form. ClientSize = New System.Drawing.Size(292, 273) Controls.Add(splitContainer1) Name = "Form1" Text = "Form1" splitContainer1.ResumeLayout(False) splitContainer2.ResumeLayout(False) ResumeLayout(False) End Sub 'InitializeComponent <STAThread()> _ Shared Sub Main() Application.Run(New Form1()) End Sub 'Main Private Sub splitContainer1_SplitterMoving(sender As System.Object, e As System.Windows.Forms.SplitterCancelEventArgs) Handles splitContainer1.SplitterMoving ' As the splitter moves, change the cursor type. Cursor.Current = System.Windows.Forms.Cursors.NoMoveVert End Sub 'splitContainer1_SplitterMoving Private Sub splitContainer1_SplitterMoved(sender As System.Object, e As System.Windows.Forms.SplitterEventArgs) Handles splitContainer1.SplitterMoved ' When the splitter stops moving, change the cursor back to the default. Cursor.Current = System.Windows.Forms.Cursors.Default End Sub 'splitContainer1_SplitterMoved End Class 'Form1
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.TreeView treeView1; private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.ListView listView2; private System.Windows.Forms.ListView listView1; public Form1() { InitializeComponent(); } private void InitializeComponent() { splitContainer1 = new System.Windows.Forms.SplitContainer(); treeView1 = new System.Windows.Forms.TreeView(); splitContainer2 = new System.Windows.Forms.SplitContainer(); listView1 = new System.Windows.Forms.ListView(); listView2 = new System.Windows.Forms.ListView(); splitContainer1.SuspendLayout(); splitContainer2.SuspendLayout(); SuspendLayout(); // 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; // Add a SplitContainer to the right panel. splitContainer1.Panel2.Controls.Add(splitContainer2); splitContainer1.Panel2.Name = "splitterPanel2"; // This TreeView control is in Panel1 of splitContainer1. treeView1.Dock = System.Windows.Forms.DockStyle.Fill; treeView1.ForeColor = System.Drawing.SystemColors.InfoText; treeView1.ImageIndex = -1; treeView1.Location = new System.Drawing.Point(0, 0); treeView1.Name = "treeView1"; treeView1.SelectedImageIndex = -1; treeView1.Size = new System.Drawing.Size(79, 273); // treeView1 is the second control in the tab order. treeView1.TabIndex = 1; // Basic SplitContainer properties. // This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed. splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; // The top panel remains the same size when the form is resized. splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; splitContainer2.Location = new System.Drawing.Point(0, 0); splitContainer2.Name = "splitContainer2"; // Create the horizontal splitter. splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; splitContainer2.Size = new System.Drawing.Size(207, 273); splitContainer2.SplitterDistance = 125; splitContainer2.SplitterWidth = 6; // splitContainer2 is the third control in the tab order. splitContainer2.TabIndex = 2; splitContainer2.Text = "splitContainer2"; // This splitter panel contains the top ListView control. splitContainer2.Panel1.Controls.Add(listView1); splitContainer2.Panel1.Name = "splitterPanel3"; // This splitter panel contains the bottom ListView control. splitContainer2.Panel2.Controls.Add(listView2); splitContainer2.Panel2.Name = "splitterPanel4"; // This ListView control is in the top panel of splitContainer2. listView1.Dock = System.Windows.Forms.DockStyle.Fill; listView1.Location = new System.Drawing.Point(0, 0); listView1.Name = "listView1"; listView1.Size = new System.Drawing.Size(207, 125); // listView1 is the fourth control in the tab order. listView1.TabIndex = 3; // This ListView control is in the bottom panel of splitContainer2. listView2.Dock = System.Windows.Forms.DockStyle.Fill; listView2.Location = new System.Drawing.Point(0, 0); listView2.Name = "listView2"; listView2.Size = new System.Drawing.Size(207, 142); // listView2 is the fifth control in the tab order. listView2.TabIndex = 4; // These are basic properties of the form. ClientSize = new System.Drawing.Size(292, 273); Controls.Add(splitContainer1); Name = "Form1"; Text = "Form1"; splitContainer1.ResumeLayout(false); splitContainer2.ResumeLayout(false); ResumeLayout(false); } [STAThread] static void Main() { Application.Run(new Form1()); } private void splitContainer1_SplitterMoving(System.Object sender, System.Windows.Forms.SplitterCancelEventArgs e) { // As the splitter moves, change the cursor type. Cursor.Current = System.Windows.Forms.Cursors.NoMoveVert; } private void splitContainer1_SplitterMoved(System.Object sender, System.Windows.Forms.SplitterEventArgs e) { // When the splitter stops moving, change the cursor back to the default. Cursor.Current=System.Windows.Forms.Cursors.Default; } }
#using <System.Data.dll> #using <System.dll> #using <System.Windows.Forms.dll> #using <System.Drawing.dll> using namespace System; using namespace System::Drawing; using namespace System::Collections; using namespace System::ComponentModel; using namespace System::Windows::Forms; using namespace System::Data; public ref class Form1: public System::Windows::Forms::Form { private: System::Windows::Forms::SplitContainer^ splitContainer1; System::Windows::Forms::TreeView^ treeView1; System::Windows::Forms::SplitContainer^ splitContainer2; System::Windows::Forms::ListView^ listView2; System::Windows::Forms::ListView^ listView1; public: Form1() { InitializeComponent(); } private: void InitializeComponent() { splitContainer1 = gcnew System::Windows::Forms::SplitContainer; treeView1 = gcnew System::Windows::Forms::TreeView; splitContainer2 = gcnew System::Windows::Forms::SplitContainer; listView1 = gcnew System::Windows::Forms::ListView; listView2 = gcnew System::Windows::Forms::ListView; splitContainer1->SuspendLayout(); splitContainer2->SuspendLayout(); SuspendLayout(); // 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; // Add a SplitContainer to the right panel. splitContainer1->Panel2->Controls->Add( splitContainer2 ); splitContainer1->Panel2->Name = "splitterPanel2"; // This TreeView control is in Panel1 of splitContainer1. treeView1->Dock = System::Windows::Forms::DockStyle::Fill; treeView1->ForeColor = System::Drawing::SystemColors::InfoText; treeView1->ImageIndex = -1; treeView1->Location = System::Drawing::Point( 0, 0 ); treeView1->Name = "treeView1"; treeView1->SelectedImageIndex = -1; treeView1->Size = System::Drawing::Size( 79, 273 ); // treeView1 is the second control in the tab order. treeView1->TabIndex = 1; // Basic SplitContainer properties. // This is a horizontal splitter whose top and bottom panels are ListView controls. The top panel is fixed. splitContainer2->Dock = System::Windows::Forms::DockStyle::Fill; // The top panel remains the same size when the form is resized. splitContainer2->FixedPanel = System::Windows::Forms::FixedPanel::Panel1; splitContainer2->Location = System::Drawing::Point( 0, 0 ); splitContainer2->Name = "splitContainer2"; // Create the horizontal splitter. splitContainer2->Orientation = System::Windows::Forms::Orientation::Horizontal; splitContainer2->Size = System::Drawing::Size( 207, 273 ); splitContainer2->SplitterDistance = 125; splitContainer2->SplitterWidth = 6; // splitContainer2 is the third control in the tab order. splitContainer2->TabIndex = 2; splitContainer2->Text = "splitContainer2"; // This splitter panel contains the top ListView control. splitContainer2->Panel1->Controls->Add( listView1 ); splitContainer2->Panel1->Name = "splitterPanel3"; // This splitter panel contains the bottom ListView control. splitContainer2->Panel2->Controls->Add( listView2 ); splitContainer2->Panel2->Name = "splitterPanel4"; // This ListView control is in the top panel of splitContainer2. listView1->Dock = System::Windows::Forms::DockStyle::Fill; listView1->Location = System::Drawing::Point( 0, 0 ); listView1->Name = "listView1"; listView1->Size = System::Drawing::Size( 207, 125 ); // listView1 is the fourth control in the tab order. listView1->TabIndex = 3; // This ListView control is in the bottom panel of splitContainer2. listView2->Dock = System::Windows::Forms::DockStyle::Fill; listView2->Location = System::Drawing::Point( 0, 0 ); listView2->Name = "listView2"; listView2->Size = System::Drawing::Size( 207, 142 ); // listView2 is the fifth control in the tab order. listView2->TabIndex = 4; // These are basic properties of the form. ClientSize = System::Drawing::Size( 292, 273 ); Controls->Add( splitContainer1 ); Name = "Form1"; Text = "Form1"; splitContainer1->ResumeLayout( false ); splitContainer2->ResumeLayout( false ); ResumeLayout( false ); } void splitContainer1_SplitterMoving( System::Object^ /*sender*/, System::Windows::Forms::SplitterCancelEventArgs ^ /*e*/ ) { // As the splitter moves, change the cursor type. ::Cursor::Current = System::Windows::Forms::Cursors::NoMoveVert; } void splitContainer1_SplitterMoved( System::Object^ /*sender*/, System::Windows::Forms::SplitterEventArgs^ /*e*/ ) { // When the splitter stops moving, change the cursor back to the default. ::Cursor::Current = System::Windows::Forms::Cursors::Default; } }; [STAThread] int main() { Application::Run( gcnew Form1 ); }
import System.*; import System.Drawing.*; import System.Collections.*; import System.ComponentModel.*; import System.Windows.Forms.*; import System.Data.*; public class Form1 extends System.Windows.Forms.Form { private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.TreeView treeView1; private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.ListView listView2; private System.Windows.Forms.ListView listView1; public Form1() { InitializeComponent(); } //Form1 private void InitializeComponent() { splitContainer1 = new System.Windows.Forms.SplitContainer(); treeView1 = new System.Windows.Forms.TreeView(); splitContainer2 = new System.Windows.Forms.SplitContainer(); listView1 = new System.Windows.Forms.ListView(); listView2 = new System.Windows.Forms.ListView(); splitContainer1.SuspendLayout(); splitContainer2.SuspendLayout(); SuspendLayout(); // 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); // Add a SplitContainer to the right panel. splitContainer1.get_Panel2().get_Controls().Add(splitContainer2); splitContainer1.get_Panel2().set_Name("splitterPanel2"); // This TreeView control is in Panel1 of splitContainer1. treeView1.set_Dock(System.Windows.Forms.DockStyle.Fill); treeView1.set_ForeColor(System.Drawing.SystemColors. get_InfoText()); treeView1.set_ImageIndex(-1); treeView1.set_Location(new System.Drawing.Point(0, 0)); treeView1.set_Name("treeView1"); treeView1.set_SelectedImageIndex(-1); treeView1.set_Size(new System.Drawing.Size(79, 273)); // treeView1 is the second control in the tab order. treeView1.set_TabIndex(1); // Basic SplitContainer properties. // This is a horizontal splitter whose top and bottom panels are // ListView controls. The top panel is fixed. splitContainer2.set_Dock(System.Windows.Forms.DockStyle.Fill); // The top panel remains the same size when the form is resized. splitContainer2.set_FixedPanel(System.Windows.Forms. FixedPanel.Panel1); splitContainer2.set_Location(new System.Drawing.Point(0, 0)); splitContainer2.set_Name("splitContainer2"); // Create the horizontal splitter. splitContainer2.set_Orientation(System.Windows.Forms. Orientation.Horizontal); splitContainer2.set_Size(new System.Drawing.Size(207, 273)); splitContainer2.set_SplitterDistance(125); splitContainer2.set_SplitterWidth(6); // splitContainer2 is the third control in the tab order. splitContainer2.set_TabIndex(2); splitContainer2.set_Text("splitContainer2"); // This splitter panel contains the top ListView control. splitContainer2.get_Panel1().get_Controls().Add(listView1); splitContainer2.get_Panel1().set_Name("splitterPanel3"); // This splitter panel contains the bottom ListView control. splitContainer2.get_Panel2().get_Controls().Add(listView2); splitContainer2.get_Panel2().set_Name("splitterPanel4"); // This ListView control is in the top panel of splitContainer2. listView1.set_Dock(System.Windows.Forms.DockStyle.Fill); listView1.set_Location(new System.Drawing.Point(0, 0)); listView1.set_Name("listView1"); listView1.set_Size(new System.Drawing.Size(207, 125)); // listView1 is the fourth control in the tab order. listView1.set_TabIndex(3); // This ListView control is in the bottom panel of splitContainer2. listView2.set_Dock(System.Windows.Forms.DockStyle.Fill); listView2.set_Location(new System.Drawing.Point(0, 0)); listView2.set_Name("listView2"); listView2.set_Size(new System.Drawing.Size(207, 142)); // listView2 is the fifth control in the tab order. listView2.set_TabIndex(4); // These are basic properties of the form. set_ClientSize(new System.Drawing.Size(292, 273)); get_Controls().Add(splitContainer1); set_Name("Form1"); set_Text("Form1"); splitContainer1.ResumeLayout(false); splitContainer2.ResumeLayout(false); ResumeLayout(false); } //InitializeComponent /** @attribute STAThread() */ public static void main(String[] args) { Application.Run(new Form1()); } //main private void splitContainer1_SplitterMoving(Object sender, System.Windows.Forms.SplitterCancelEventArgs e) { // As the splitter moves, change the cursor type. get_Cursor().set_Current(System.Windows.Forms.Cursors. get_NoMoveVert()); } //splitContainer1_SplitterMoving private void splitContainer1_SplitterMoved(Object sender, System.Windows.Forms.SplitterEventArgs e) { // When the splitter stops moving, change the cursor // back to the default. get_Cursor().set_Current(System.Windows.Forms.Cursors. get_Default()); } //splitContainer1_SplitterMoved } //Form1

System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.SplitContainer


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 メンバ
System.Windows.Forms 名前空間
その他の技術情報
SplitContainer コントロール (Windows フォーム)
SplitContainer コントロールのサンプル
Weblioに収録されているすべての辞書からSplitContainer クラスを検索する場合は、下記のリンクをクリックしてください。

- SplitContainer クラスのページへのリンク