SplitContainer.Dock SplitContainer.Dock SplitContainer.Dock SplitContainer.Dock Property

정의

컨테이너의 가장자리에 연결되는 SplitContainer 테두리를 가져오거나 설정합니다.Gets or sets which SplitContainer borders are attached to the edges of the container.

public:
 property System::Windows::Forms::DockStyle Dock { System::Windows::Forms::DockStyle get(); void set(System::Windows::Forms::DockStyle value); };
public System.Windows.Forms.DockStyle Dock { get; set; }
member this.Dock : System.Windows.Forms.DockStyle with get, set
Public Property Dock As DockStyle

속성 값

DockStyle 값 중 하나입니다.One of the DockStyle values. 기본값은 None입니다.The default value is None.

예제

다음 코드 예제에서는 세로 분할자입니다 Dock 속성이 Fill합니다.The following code example shows a vertical splitter whose Dock property is set to Fill. 세로 분할의 다른 기본 속성도 표시 됩니다.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

설명

도킹할 수 있습니다는 SplitContainer 해당 컨테이너의 모든 가장자리에 고정할 수는 SplitContainer 컨테이너의 모든 가장자리에 있도록는 SplitContainer 전적으로 컨테이너를 채웁니다.You can dock a SplitContainer to any edge of its container, or you can dock a SplitContainer to all edges of the container so that the SplitContainer entirely fills the container. 예를 들어이 속성을 설정 DockStyle.Left 의 왼쪽된 가장자리를 연결 하는 SplitContainer 해당 컨테이너의 왼쪽 가장자리입니다.For example, set this property to DockStyle.Left to attach the left edge of the SplitContainer to the left edge of its container. Z 순서에 컨트롤 도킹 됩니다.Controls are docked in z-order.

참고

화면 깊이 차원에 해당 하는 z 순서 및 x 좌표와 y 순서에 따라 가로 및 세로 크기를 각각.The z-order corresponds to the depth dimension of the screen, and the x-order and y-order corresponds to the horizontal and vertical dimensions, respectively. Z 순서 컨트롤 또는 windows 겹치는 나 화면에서 동일한 공간을 차지할 수 있는 앞에 표시 될 개체를 정의 합니다.Z-order defines which object appears in front of which, in cases where controls or windows can overlap or occupy the same space on the screen. 컨트롤 또는 z-순서의 맨 위에 있는 창 다른 모든 컨트롤 또는 windows 맨 위에 표시 되 고 인덱스 0에 의해 참조 되는 Controls 속성입니다.A control or window at the top of the z-order appears on top of all other controls or windows and is referenced by an index of 0 in the Controls property. 다른 모든 컨트롤 또는 windows 아래 표시 되 고 인덱스에서 참조 하는 컨트롤 또는 z-순서의 맨 아래에 있는 창 (Controls.Count-1)Controls 속성입니다.A control or window at the bottom of the z-order appears underneath all other controls or windows and is referenced by an index of (Controls.Count-1) in the Controls property.

고정 및 도킹 컨트롤 에 대 한 자세한 내용은 방법: Windows Forms를 사용 하 여 다중 창 사용자 인터페이스를 만듭니다.For more information about anchoring and docking controls, see How to: Create a Multipane User Interface with Windows Forms.

적용 대상

추가 정보