SplitContainer.SplitterDistance SplitContainer.SplitterDistance SplitContainer.SplitterDistance SplitContainer.SplitterDistance Property

정의

SplitContainer의 왼쪽 가장자리나 위쪽 가장자리에서 분할자까지의 거리(픽셀)를 가져오거나 설정합니다.Gets or sets the location of the splitter, in pixels, from the left or top edge of the SplitContainer.

public:
 property int SplitterDistance { int get(); void set(int value); };
[System.ComponentModel.SettingsBindable(true)]
public int SplitterDistance { get; set; }
member this.SplitterDistance : int with get, set
Public Property SplitterDistance As Integer

속성 값

Int32의 왼쪽 가장자리나 위쪽 가장자리에서 분할자까지의 거리(픽셀)를 나타내는 SplitContainer입니다.An Int32 representing the location of the splitter, in pixels, from the left or top edge of the SplitContainer. 기본값은 50픽셀입니다.The default value is 50 pixels.

예외

값이 방향과 호환되지 않는 경우The value is incompatible with the orientation.

예제

다음 코드 예제는 초기 세로 컨테이너의 왼쪽된 가장자리에서 분할자 까지의 거리가 79 픽셀을 지정 합니다.The following code example specifies that the initial distance of the vertical splitter from the left edge of the container is 79 pixels. 세로 분할의 다른 기본 속성도 표시 됩니다.Other basic properties of a vertical splitter are also shown. 이 예제는에 대해 제공 된 큰 예제의 일부는 SplitContainer 클래스입니다.This example is part of a larger example provided for the SplitContainer class.

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

설명

사용 된 SplitterDistance 속성을 확인 하거나 (픽셀 단위) 컨테이너의 왼쪽 가장자리나 위쪽 가장자리에서 분할자 까지의 거리를 지정 합니다.Use the SplitterDistance property to determine or specify the distance in pixels of the splitter from the left or top edge of the container. 모두 초기 거리를 지정 하 고 디자인 타임에 거리를 변경 하거나 실행할 수 시간입니다.You can both specify an initial distance and change the distance at design time or run time. 하는 경우 Orientation 됩니다 HorizontalSplitterDistance 의 위쪽 가장자리에서 픽셀 단위로 계산 됩니다는 SplitContainer합니다.If Orientation is Horizontal, SplitterDistance is calculated in pixels from the top edge of the SplitContainer. 하는 경우 Orientation 됩니다 Vertical, SplitterDistance 의 왼쪽된 가장자리에서 픽셀 단위로 계산 됩니다는 SplitContainer합니다.If Orientation is Vertical, SplitterDistance is calculated in pixels from the left edge of the SplitContainer.

적용 대상

추가 정보