다음을 통해 공유


Splitter.MinSize 속성

Splitter 컨트롤과 이 컨트롤이 도킹되는 컨테이너 가장자리 사이에서 유지해야 할 최소 거리를 가져오거나 설정합니다. Splitter.MinSizeSplitContainer.Panel1MinSizeSplitContainer.Panel2MinSize로 대체되었으며 이전 버전과의 호환성을 위해서만 제공됩니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
<LocalizableAttribute(True)> _
Public Property MinSize As Integer
‘사용 방법
Dim instance As Splitter
Dim value As Integer

value = instance.MinSize

instance.MinSize = value
[LocalizableAttribute(true)] 
public int MinSize { get; set; }
[LocalizableAttribute(true)] 
public:
property int MinSize {
    int get ();
    void set (int value);
}
/** @property */
public int get_MinSize ()

/** @property */
public void set_MinSize (int value)
public function get MinSize () : int

public function set MinSize (value : int)

속성 값

Splitter 컨트롤과 이 컨트롤이 도킹되는 컨테이너 가장자리 사이의 최소 거리(픽셀)입니다. 기본값은 25입니다.

설명

가로 Splitter 컨트롤(컨테이너의 위쪽이나 아래쪽에 도킹된 Splitter 컨트롤)의 경우, 이 값은 크기를 조정할 수 있는 컨트롤의 최소 높이에 해당합니다. 세로 Splitter 컨트롤(컨테이너의 왼쪽이나 오른쪽에 도킹된 Splitter 컨트롤)의 경우, 이 값은 크기를 조정할 수 있는 컨트롤의 최소 너비에 해당합니다. 이 속성에서 지정한 한계를 지나 분할자를 이동할 수 없습니다.

참고

MinSize 속성을 음수 값으로 설정하면 속성 값이 0으로 다시 설정됩니다.

예제

다음 코드 예제에서는 TreeViewListView 컨트롤과 함께 Splitter 컨트롤을 사용하여 Windows 탐색기와 유사한 창을 만듭니다. TreeViewListView 컨트롤을 확인할 수 있도록 두 컨트롤에 노드와 항목이 추가됩니다. 예제에서는 SplitterMinExtraMinSize 속성을 사용하여 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

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0에서 지원

참고 항목

참조

Splitter 클래스
Splitter 멤버
System.Windows.Forms 네임스페이스
Splitter.MinExtra 속성