다음을 통해 공유


ScrollableControl.DockPaddingEdges.Right 속성

도킹된 컨트롤의 오른쪽 가장자리에 대해 안쪽 여백 너비를 가져오거나 설정합니다.

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

구문

‘선언
Public Property Right As Integer
‘사용 방법
Dim instance As DockPaddingEdges
Dim value As Integer

value = instance.Right

instance.Right = value
public int Right { get; set; }
public:
property int Right {
    int get ();
    void set (int value);
}
/** @property */
public int get_Right ()

/** @property */
public void set_Right (int value)
public function get Right () : int

public function set Right (value : int)

속성 값

안쪽 여백 너비(픽셀)입니다.

설명

이 속성에 할당된 안쪽 여백 너비는 도킹된 컨트롤의 오른쪽 가장자리에만 적용됩니다.

예제

다음 코드 예제에서는 파생 클래스인 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++;
}

플랫폼

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 클래스
ScrollableControl.DockPaddingEdges 멤버
System.Windows.Forms 네임스페이스
All
Bottom
Top
Left