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

Dim instance As SplitContainer Dim value As Integer value = instance.SplitterDistance instance.SplitterDistance = value
[LocalizableAttribute(true)] public: property int SplitterDistance { int get (); void set (int value); }
/** @property */ public int get_SplitterDistance () /** @property */ public void set_SplitterDistance (int value)
SplitContainer の左端または上端から見た分割線の位置をピクセル単位で表す System.Int32。既定値は 40 ピクセルです。


SplitterDistance プロパティを使用すると、コンテナの左端または上端から分割線までの距離を、ピクセル単位で特定または指定できます。距離を初期値として指定することも、デザイン時または実行時に距離を変更することもできます。Orientation が Horizontal の場合、SplitterDistance は SplitContainer の上端からピクセル単位で計算されます。Orientation が Vertical の場合、SplitterDistance は SplitContainer の左端からピクセル単位で計算されます。

コンテナの左端から垂直方向の分割線までの距離の初期値を 79 ピクセルに指定するコード例を次に示します。また、垂直方向の分割線の他の基本的なプロパティも示します。このコード例は、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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSplitContainer.SplitterDistance プロパティを検索する場合は、下記のリンクをクリックしてください。

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