Splitter.MinExtra 속성

정의

Splitter 컨트롤과 컨테이너의 반대쪽 가장자리(또는 해당 쪽에 도킹된 가장 가까운 컨트롤) 사이에서 유지해야 할 최소 거리를 가져오거나 설정합니다. MinExtraSplitContainer에 있는 유사한 속성으로 대체되었으며 이전 버전과의 호환성을 위해서만 제공됩니다.

public:
 property int MinExtra { int get(); void set(int value); };
public int MinExtra { get; set; }
member this.MinExtra : int with get, set
Public Property MinExtra As Integer

속성 값

Int32

Splitter 컨트롤과 컨테이너의 반대쪽 가장자리(또는 해당 쪽에 도킹된 컨트롤 중 가장 가까이 있는 컨트롤) 사이의 최소 거리(픽셀)입니다. 기본값은 25입니다.

예제

다음 코드 예제에서는 컨트롤과 TreeView 함께 컨트롤 및 ListView 컨트롤을 사용하여 Splitter Windows 탐색기와 유사한 창을 만듭니다. 및 ListView 컨트롤을 TreeView 식별하기 위해 노드와 항목이 두 컨트롤 모두에 추가됩니다. 이 예제에서는 또는 컨트롤의 크기가 Splitter 너무 작거나 ListView 너무 크지 않도록 하기 TreeView 위해 해당 속성과 MinSize 속성을 사용합니다MinExtra. 이 예제에서는 이 예제에서 만든 메서드가 a Form 내에서 정의되고 메서드가 생성 Form자에서 호출되어야 합니다.

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.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 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

설명

가로 Splitter 컨트롤( Splitter 컨테이너의 위쪽 또는 아래쪽에 도킹된 컨트롤)의 경우 도킹되지 않은 컨트롤용으로 예약된 컨테이너 영역의 최소 높이가 컨트롤의 Splitter 높이를 뺀 값입니다. 세 Splitter 로 컨트롤( Splitter 컨테이너의 왼쪽 또는 오른쪽에 도킹된 컨트롤)의 경우 도킹 해제된 컨트롤용으로 예약된 컨테이너 영역의 최소 너비는 컨트롤의 Splitter 너비를 뺀 값입니다. 사용자가 이 속성에 지정된 제한을 초과하여 분할자를 이동할 수 없습니다.

참고

속성이 음수 MinExtra 값으로 설정되면 속성 값이 0으로 다시 설정됩니다.

적용 대상

추가 정보