Splitter.MinSize Splitter.MinSize Splitter.MinSize Splitter.MinSize Property

정의

Splitter 컨트롤과 이 컨트롤이 도킹되는 컨테이너 가장자리 사이에서 유지해야 할 최소 거리를 가져오거나 설정합니다.Gets or sets the minimum distance that must remain between the splitter control and the container edge that the control is docked to. MinSizePanel1MinSizePanel2MinSize로 대체되었으며 이전 버전과의 호환성을 위해서만 제공됩니다.MinSize has been replaced by Panel1MinSize and Panel2MinSize and is provided only for compatibility with previous versions.

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

속성 값

Splitter 컨트롤과 이 컨트롤이 도킹되는 컨테이너 가장자리 사이의 최소 거리(픽셀)입니다.The minimum distance, in pixels, between the Splitter control and the container edge that the control is docked to. 기본값은 25입니다.The default is 25.

예제

다음 코드 예제에서는 한 Splitter 컨트롤과 함께 TreeViewListView 창을 Windows 탐색기와 비슷한 만들려면 컨트롤입니다.The following code example uses a Splitter control in combination with TreeView and ListView controls to create a window similar to Windows Explorer. 식별 하는 TreeViewListView 컨트롤, 노드 및 항목은 두 컨트롤에 추가 됩니다.To identify the TreeView and ListView controls, nodes and items are added to both controls. 예제에서는 MinExtraMinSize 의 속성을 Splitter 방지 하기 위해를 TreeView 또는 ListView 너무 작거나 너무 큰 크기 중에서 컨트롤입니다.The example uses the MinExtra and MinSize properties of the Splitter to prevent the TreeView or ListView control from being sized too small or too large. 이 예제에서는이 예제에서 만든 메서드 내에서 정의 되어 있어야를 Form 의 생성자에서 메서드가 호출 되는 및를 Form입니다.This example requires that the method created in this example is defined within a Form and that the method is called from the constructor of the 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 'CreateMySplitControls

설명

가로 Splitter 컨트롤 (을 Splitter 위쪽 이나 아래쪽 컨테이너에 컨트롤 도킹),이 값은 크기 조정 가능한 컨트롤의 최소 높이입니다.For a horizontal Splitter control (a Splitter control docked to the top or bottom of a container), this value is the minimum height of the resizable control. 세로 Splitter 컨트롤 (을 Splitter 컨트롤이 도킹 컨테이너의 오른쪽 이나 왼쪽으로),이 값은 크기 조정 가능한 컨트롤의 최소 너비입니다.For a vertical Splitter control (a Splitter control docked to the left or right of a container), this value is the minimum width of the resizable control. 사용자는이 속성에 지정 된 한도 초과 분할자를 이동할 수 없습니다.The user cannot move the splitter past the limit specified by this property.

참고

경우는 MinSize 음수 값으로 속성을 설정 하면 속성 값을 0으로 다시 설정 됩니다.If the MinSize property is set to a negative value, the property value is reset to 0.

적용 대상

추가 정보