다음을 통해 공유


ScrollableControl.DockPaddingEdges 클래스

도킹된 컨트롤의 테두리 안쪽 여백을 결정합니다.

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

구문

‘선언
Public Class DockPaddingEdges
    Implements ICloneable
‘사용 방법
Dim instance As DockPaddingEdges
public class DockPaddingEdges : ICloneable
public ref class DockPaddingEdges : ICloneable
public class DockPaddingEdges implements ICloneable
public class DockPaddingEdges implements ICloneable

설명

ScrollableControl.DockPaddingEdges 클래스는 도킹된 컨트롤의 지정된 가장자리나 모든 가장자리에 여백을 만듭니다. Bottom, Top, Left, Right 속성을 설정하여 개별 가장자리에 대해 이 여백의 너비를 설정할 수 있습니다. 또한 All 속성을 설정하여 모든 가장자리를 같은 너비로 동시에 설정할 수 있습니다. 컨트롤의 크기가 해당 컨테이너에 비해 너무 크면 지정된 여백 너비를 빼서 컨테이너에 맞게 컨트롤의 크기를 조정합니다.

예제

다음 코드 예제에서는 파생 클래스인 Panel을 사용합니다. 예제에서는 단추를 Panel 컨트롤에 도킹하고 ScrollableControl.DockPaddingEdges 속성을 순환하여 단추를 클릭할 때 각각을 개별적으로 설정합니다. 이 코드를 실행하려면 폼에 Panel 컨트롤과 Button이 인스턴스화되어 있고 myCounter라는 클래스 수준 멤버 변수가 부호 있는 32비트 정수로 선언되어 있어야 합니다. 이 코드는 단추의 Click 이벤트에서 호출해야 합니다.

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
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;
 }
 
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++;
}

상속 계층 구조

System.Object
  System.Windows.Forms.ScrollableControl.DockPaddingEdges

스레드로부터의 안전성

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

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에서 지원

참고 항목

참조

ScrollableControl.DockPaddingEdges 멤버
System.Windows.Forms 네임스페이스
ScrollableControl 클래스