다음을 통해 공유


DockStyle 열거형

컨트롤이 도킹되는 위치와 방법을 지정합니다.

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

구문

‘선언
Public Enumeration DockStyle
‘사용 방법
Dim instance As DockStyle
public enum DockStyle
public enum class DockStyle
public enum DockStyle
public enum DockStyle

멤버

  멤버 이름 설명
Supported by the .NET Compact Framework Bottom 컨트롤의 아래쪽 가장자리가 포함된 컨트롤의 아래쪽에 도킹됩니다. 
Supported by the .NET Compact Framework Fill 컨트롤의 모든 가장자리가 포함 컨트롤의 모든 가장자리에 도킹되고 가장자리의 크기는 알맞게 조정됩니다. 
Supported by the .NET Compact Framework Left 컨트롤의 왼쪽 가장자리가 포함된 컨트롤의 왼쪽 가장자리에 도킹됩니다. 
Supported by the .NET Compact Framework None 컨트롤이 도킹되지 않습니다. 
Supported by the .NET Compact Framework Right 컨트롤의 오른쪽 가장자리가 포함된 컨트롤의 오른쪽 가장자리에 도킹됩니다. 
Supported by the .NET Compact Framework Top 컨트롤의 위쪽 가장자리가 포함된 컨트롤의 위쪽에 도킹됩니다. 

설명

하나의 컨트롤이 해당 컨테이너의 가장자리에 도킹되면 이 컨트롤은 컨테이너의 크기가 바뀔 때 항상 가장자리에 대한 플러시에 놓이게 됩니다. 둘 이상의 컨트롤이 가장자리에 도킹되면 컨트롤은 해당 Z 순서에 따라 나란히 표시되며 Z 순서 이상의 컨트롤은 컨테이너의 가장자리에서 떨어진 곳에 놓이게 됩니다.

Left, Right, Top 또는 Bottom을 선택하면 컨트롤의 지정된 가장자리와 반대쪽 가장자리가 포함된 컨트롤의 해당 가장자리와 동일한 크기로 조정됩니다. Fill을 선택하면 컨트롤의 네 가장자리가 포함된 컨트롤의 가장자리와 동일한 크기로 조정됩니다.

예제

다음 예제에서는 GroupBox를 만들고 그 공용 속성의 일부를 설정합니다. 이 예제에서는 TextBox를 만든 다음 텍스트 상자의 Location을 그룹 상자 내에 설정합니다. 다음에는 그룹 상자의 Text 속성을 설정하고 폼의 상단에 그룹 상자를 도킹시킵니다. 마지막으로 Enabled 속성을 false로 설정하여 그룹 상자를 비활성화합니다. 이렇게 하면 그룹 상자에 포함된 모든 컨트롤도 비활성화됩니다.

' Add a GroupBox to a form and set some of its common properties.
Private Sub AddMyGroupBox()
   ' Create a GroupBox and add a TextBox to it.
   Dim groupBox1 As New GroupBox()
   Dim textBox1 As New TextBox()
   textBox1.Location = New Point(15, 15)
   groupBox1.Controls.Add(textBox1)
   
   ' Set the Text and Dock properties of the GroupBox.
   groupBox1.Text = "MyGroupBox"
   groupBox1.Dock = DockStyle.Top
   
   ' Disable the GroupBox (which disables all its child controls)
   groupBox1.Enabled = False
   
   ' Add the Groupbox to the form.
   Me.Controls.Add(groupBox1)
End Sub
// Add a GroupBox to a form and set some of its common properties.
private void AddMyGroupBox()
{
   // Create a GroupBox and add a TextBox to it.
   GroupBox groupBox1 = new GroupBox();
   TextBox textBox1 = new TextBox();
   textBox1.Location = new Point(15, 15);
   groupBox1.Controls.Add(textBox1);

   // Set the Text and Dock properties of the GroupBox.
   groupBox1.Text = "MyGroupBox";
   groupBox1.Dock = DockStyle.Top;

   // Disable the GroupBox (which disables all its child controls)
   groupBox1.Enabled = false;

   // Add the Groupbox to the form.
   this.Controls.Add(groupBox1);
}
   // Add a GroupBox to a form and set some of its common properties.
private:
   void AddMyGroupBox()
   {
      // Create a GroupBox and add a TextBox to it.
      GroupBox^ groupBox1 = gcnew GroupBox;
      TextBox^ textBox1 = gcnew TextBox;
      textBox1->Location = Point(15,15);
      groupBox1->Controls->Add( textBox1 );

      // Set the Text and Dock properties of the GroupBox.
      groupBox1->Text = "MyGroupBox";
      groupBox1->Dock = DockStyle::Top;

      // Disable the GroupBox (which disables all its child controls)
      groupBox1->Enabled = false;

      // Add the Groupbox to the form.
      this->Controls->Add( groupBox1 );
   }
// Add a GroupBox to a form and set some of its common properties.
private void AddMyGroupBox()
{
    // Create a GroupBox and add a TextBox to it.
    GroupBox groupBox1 = new GroupBox();
    TextBox textBox1 = new TextBox();
    textBox1.set_Location(new Point(15, 15));
    groupBox1.get_Controls().Add(textBox1);
    // Set the Text and Dock properties of the GroupBox.
    groupBox1.set_Text("MyGroupBox");
    groupBox1.set_Dock(DockStyle.Top);
    // Disable the GroupBox (which disables all its child controls)
    groupBox1.set_Enabled(false);
    // Add the Groupbox to the form.
    this.get_Controls().Add(groupBox1);
} //AddMyGroupBox

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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에서 지원

참고 항목

참조

System.Windows.Forms 네임스페이스
Control.Dock 속성