Splitter クラスとは? わかりやすく解説

Splitter クラス

ドッキングされたコントロールユーザーサイズ変更するための分割コントロール表しますSplitter代わりに SplitContainer が採用されているため、これは以前のバージョン互換性維持するためだけに用意されています。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

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

Splitter コントロール使用すると、ユーザー実行時Splitter コントロールの端にドッキングされているコントロールサイズ変更できますユーザーSplitter コントロール上にマウス ポインタ通過させると、Splitter コントロールドッキングされているコントロールサイズ変更できることを示すためにカーソル変化しますSplitter コントロール使用すると、ユーザーは、ドッキング順序において直前ドッキングされたコントロールサイズ変更できます。したがってユーザードッキングされたコントロールサイズ変更できるようにするには、ユーザーによるサイズ変更可能にするコントロールコンテナの端にドッキングしてから、分割コントロールをそのコンテナの同じ側にドッキングします。たとえば、Windows エクスプローラ類似したウィンドウ作成するには、TreeView コントロールフォーム追加し、その Dock プロパティDockStyle.Left設定しますSplitter コントロールフォーム追加し、その Dock プロパティ同様に DockStyle.Left設定しますフォーム レイアウト完成するには、ListView コントロール追加し、その Dock プロパティDockStyle.Fill設定してListViewフォーム上の残り空間占有させます実行時に、Splitter コントロール移動することによって、ユーザーTreeView コントロールの幅を (同様に ListView コントロールの幅も) 変更できます

ドッキングされたコントロールサイズが、Splitter コントロールによってユーザー使用できないほど小さくならないようにするには、MinExtra プロパティおよび MinSize プロパティ使用しますMinExtra プロパティおよび MinSize プロパティは、左右に (水平方向Splitter コントロール場合上下に) ドッキングされるコントロール最小の有効サイズ決定しますSplitter コントロールドッキングされている、フォーム上のその他のコントロール特定のスタイル境界線表示する場合は、BorderStyle プロパティ使用して分割コントロールドッキングされたコントロール境界線スタイル一致させることができます

Splitter コントロールドッキング先のコントロールに、サイズの上限を設定する必要が生じ場合あります。SplitterMoved イベントおよび SplitterMoving イベント使用すると、ユーザーどのような場合ドッキングされたコントロールサイズ変更するのかを確認できますSplitterMoved イベントまたは SplitterMoving イベントイベント ハンドラで SplitPosition プロパティ使用してSplitter コントロールドッキングされているコントロールサイズ決定しSplitPosition プロパティ異なる値に設定してドッキングされたコントロールの幅指定した最大幅 (または水平方向配置されSplitter コントロール場合は高さ) に制限できます

メモメモ

Splitter コントロール使用しているコントロールサイズ変更は、マウス使用する場合限り実行できますキーボード使用して Splitter コントロールにはアクセスできません。

使用例使用例

Splitter コントロールTreeView コントロールおよび ListView コントロール組み合わせて使用しWindows エクスプローラ類似したウィンドウ作成するコード例次に示しますTreeView コントロールおよび ListView コントロール識別するには、ノードと項目を両方コントロール追加します。この例では、SplitterMinExtra プロパティおよび MinSize プロパティ使用してTreeView コントロールまたは ListView コントロール小さすぎるサイズ大きすぎるサイズ変更されないようにしています。この例では、この例で作成されているメソッドForm 内で定義し、その Formコンストラクタから呼び出す必要があります

Private Sub CreateMySplitControls()
   ' Create TreeView, ListView, and Splitter controls.
   Dim treeView1 As New
 TreeView()
   Dim listView1 As New
 ListView()
   Dim splitter1 As New
 Splitter()
   
   ' Set the TreeView control to dock to the left side of the form.
   treeView1.Dock = DockStyle.Left
   ' Set the Splitter to dock to the left side of the TreeView control.
   splitter1.Dock = DockStyle.Left
   ' Set the minimum size the ListView control can be sized to.
      splitter1.MinExtra = 100
   ' Set the minimum size the TreeView control can be sized to.
      splitter1.MinSize = 75
   ' Set the ListView control to fill the remaining space on the form.
      listView1.Dock = DockStyle.Fill

      ' Add a TreeView and a ListView item to identify the controls
 on the form.
      treeView1.Nodes.Add("TreeView Node")
      listView1.Items.Add("ListView Item")
   
   ' Add the controls in reverse order to the form to ensure proper
 location.
   Me.Controls.AddRange(New Control() {listView1,
 splitter1, treeView1})
End Sub 'CreateMySplitControls

private void CreateMySplitControls()
{
    // Create TreeView, ListView, and Splitter controls.
    TreeView treeView1 = new TreeView();
    ListView listView1 = new ListView();
    Splitter splitter1 = new Splitter();

    // Set the TreeView control to dock to the left side of the form.
    treeView1.Dock = DockStyle.Left;
    // Set the Splitter to dock to the left side of the TreeView control.
    splitter1.Dock = DockStyle.Left;
    // Set the minimum size the ListView control can be sized to.
    splitter1.MinExtra = 100;
    // Set the minimum size the TreeView control can be sized to.
    splitter1.MinSize = 75;
    // Set the ListView control to fill the remaining space on the form.
    listView1.Dock = DockStyle.Fill;
    // Add a TreeView and a ListView item to identify the controls on
 the form.
    treeView1.Nodes.Add("TreeView Node");
    listView1.Items.Add("ListView Item");

    // Add the controls in reverse order to the form to ensure proper
 location.
    this.Controls.AddRange(new Control[]{listView1,
 splitter1, treeView1});
}
private:
   void CreateMySplitControls()
   {
      // Create TreeView, ListView, and Splitter controls.
      TreeView^ treeView1 = gcnew TreeView;
      ListView^ listView1 = gcnew ListView;
      Splitter^ splitter1 = gcnew Splitter;

      // Set the TreeView control to dock to the left side of the form.
      treeView1->Dock = DockStyle::Left;

      // Set the Splitter to dock to the left side of the TreeView control.
      splitter1->Dock = DockStyle::Left;

      // Set the minimum size the ListView control can be sized to.
      splitter1->MinExtra = 100;

      // Set the minimum size the TreeView control can be sized to.
      splitter1->MinSize = 75;

      // Set the ListView control to fill the remaining space on the
 form.
      listView1->Dock = DockStyle::Fill;

      // Add a TreeView and a ListView item to identify the controls on
 the form.
      treeView1->Nodes->Add( "TreeView Node" );
      listView1->Items->Add( "ListView Item" );

      // Add the controls in reverse order to the form to ensure proper
 location.
      array<Control^>^temp0 = {listView1,splitter1,treeView1};
      this->Controls->AddRange( temp0 );
   }
private void CreateMySplitControls()
{
    // Create TreeView, ListView, and Splitter controls.
    TreeView treeView1 = new TreeView();
    ListView listView1 = new ListView();
    Splitter splitter1 = new Splitter();
    // Set the TreeView control to dock to the left side of the form.
    treeView1.set_Dock(DockStyle.Left);
    // Set the Splitter to dock to the left side of the TreeView control.
    splitter1.set_Dock(DockStyle.Left);
    // Set the minimum size the ListView control can be sized to.
    splitter1.set_MinExtra(100);
    // Set the minimum size the TreeView control can be sized to.
    splitter1.set_MinSize(75);
    // Set the ListView control to fill the remaining space on the form.
    listView1.set_Dock(DockStyle.Fill);
    // Add a TreeView and a ListView item to identify the controls on
 the 
    // form.
    treeView1.get_Nodes().Add("TreeView Node");
    listView1.get_Items().Add("ListView Item");
    // Add the controls in reverse order to the form to ensure proper
 
    // location.
    this.get_Controls().AddRange(new Control[]
 { listView1, splitter1, 
        treeView1 });
} //CreateMySplitControls
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
        System.Windows.Forms.Splitter
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からSplitter クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSplitter クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSplitter クラス を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Splitter クラス」の関連用語

Splitter クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Splitter クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS