ScrollableControl.DockPadding 속성

정의

컨트롤의 모든 가장자리에 대 한 도킹 안쪽 여백 설정의 가져옵니다.Gets the dock padding settings for all edges of the control.

public:
 property System::Windows::Forms::ScrollableControl::DockPaddingEdges ^ DockPadding { System::Windows::Forms::ScrollableControl::DockPaddingEdges ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.ScrollableControl.DockPaddingEdges DockPadding { get; }
member this.DockPadding : System.Windows.Forms.ScrollableControl.DockPaddingEdges
Public ReadOnly Property DockPadding As ScrollableControl.DockPaddingEdges

속성 값

도킹된 컨트롤의 모든 가장자리에 대한 안쪽 여백을 나타내는 ScrollableControl.DockPaddingEdges입니다.A ScrollableControl.DockPaddingEdges that represents the padding for all the edges of a docked control.

특성

예제

다음 코드 예제에서는 파생된 클래스인 Panel합니다.The following code example uses the derived class, Panel. 예제에서는 단추 패널 컨트롤에 도킹 하 고 순환는 ScrollableControl.DockPaddingEdges 속성을 각각 단추 클릭에 개별적으로 설정 합니다.The example docks a button in a panel control and cycles through the ScrollableControl.DockPaddingEdges properties, setting each individually on the click of the button. 이 예제를 사용 하려면 Panel 컨트롤의 인스턴스와 폼에 Button를 만들고 myCounter 라는 클래스 수준 멤버 변수를 32 비트 부호 있는 정수로 선언 해야 합니다.The example requires that you have created an instance of a Panel control and a Button on a form, and you have declared a class level member variable named myCounter as a 32-bit signed integer. 단추의 Click 이벤트에서이 코드를 호출 해야 합니다.You should call this code on the Click event of the button.

void SetDockPadding()
{
   // Dock the button in the panel.
   button1->Dock = System::Windows::Forms::DockStyle::Fill;

   // Reset the counter if it is greater than 5.
   if ( myCounter > 5 )
   {
      myCounter = 0;
   }

   // Set the appropriate DockPadding and display
   // which one was set on the button face.
   switch ( myCounter )
   {
      case 0:
         panel1->DockPadding->All = 0;
         button1->Text = "Start";
         break;

      case 1:
         panel1->DockPadding->Top = 10;
         button1->Text = "Top";
         break;

      case 2:
         panel1->DockPadding->Bottom = 10;
         button1->Text = "Bottom";
         break;

      case 3:
         panel1->DockPadding->Left = 10;
         button1->Text = "Left";
         break;

      case 4:
         panel1->DockPadding->Right = 10;
         button1->Text = "Right";
         break;

      case 5:
         panel1->DockPadding->All = 20;
         button1->Text = "All";
         break;
   }
   myCounter++;
}
private void SetDockPadding()
 {
    // Dock the button in the panel.
    button1.Dock = System.Windows.Forms.DockStyle.Fill;
    
    // Reset the counter if it is greater than 5.
    if (myCounter > 5)
    {
       myCounter = 0;
    }
 
    // Set the appropriate DockPadding and display
    // which one was set on the button face.
    switch (myCounter)
    {
       case 0:
          panel1.DockPadding.All = 0;
          button1.Text = "Start";
          break;
       case 1:
          panel1.DockPadding.Top = 10;
          button1.Text = "Top";
          break;
       case 2:
          panel1.DockPadding.Bottom = 10;
          button1.Text = "Bottom";
          break;
       case 3:
          panel1.DockPadding.Left = 10;
          button1.Text = "Left";
          break;
       case 4:
          panel1.DockPadding.Right = 10;
          button1.Text = "Right";
          break;
       case 5:
          panel1.DockPadding.All = 20;
          button1.Text = "All";
          break;
    }
    
    // Increment the counter.
    myCounter += 1;
 }
 
Private Sub SetDockPadding()
    ' Dock the button in the panel.
    button1.Dock = System.Windows.Forms.DockStyle.Fill
    
    ' Reset the counter if it is greater than 5.
    If myCounter > 5 Then
        myCounter = 0
    End If
    
    ' Set the appropriate DockPadding and display
    ' which one was set on the button face.
    Select Case myCounter
        Case 0
            panel1.DockPadding.All = 0
            button1.Text = "Start"
        Case 1
            panel1.DockPadding.Top = 10
            button1.Text = "Top"
        Case 2
            panel1.DockPadding.Bottom = 10
            button1.Text = "Bottom"
        Case 3
            panel1.DockPadding.Left = 10
            button1.Text = "Left"
        Case 4
            panel1.DockPadding.Right = 10
            button1.Text = "Right"
        Case 5
            panel1.DockPadding.All = 20
            button1.Text = "All"
    End Select
    
    ' Increment the counter.
    myCounter += 1
End Sub

설명

이 속성에는이 컨트롤 도킹 된 구성 요소에 대 한 내부 테두리를 제어합니다.This property controls the border inside of this control for docked components.

적용 대상

추가 정보