ScrollableControl.DockPaddingEdges 클래스

정의

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

public: ref class ScrollableControl::DockPaddingEdges : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ScrollableControl+DockPaddingEdgesConverter))]
public class ScrollableControl.DockPaddingEdges : ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ScrollableControl+DockPaddingEdgesConverter))>]
type ScrollableControl.DockPaddingEdges = class
    interface ICloneable
Public Class ScrollableControl.DockPaddingEdges
Implements ICloneable
상속
ScrollableControl.DockPaddingEdges
특성
구현

예제

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

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

설명

ScrollableControl.DockPaddingEdges 클래스 지정된 가장자리에 도킹된 된 컨트롤의 모든 가장자리에 여백을 만듭니다. 다음 속성을 설정 하 여 각 개별 가장자리에 대 한이 여백 너비를 설정할 수 있습니다: Bottom, TopLeft, Right합니다. 또는 설정할 수 있습니다 모든 가장자리 동일한 너비로 동시에 설정 하 여는 All 속성입니다. 컨트롤의 크기가 너무 커서 해당 컨테이너에 대 한 경우 컨트롤 컨테이너에 지정된 된 여백 너비에서 뺀 값에 맞게 크기가 조정 됩니다.

속성

All

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

Bottom

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

Left

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

Right

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

Top

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

메서드

Equals(Object)

이 API는 제품 인프라를 지원하며 코드에서 직접 사용되지 않습니다.

지정한 개체와 현재 ScrollableControl.DockPaddingEdges 개체가 같은지 여부를 확인합니다.

GetHashCode()

특정 유형에 대한 해시 함수로 사용합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

빈 문자열을 반환합니다.

명시적 인터페이스 구현

ICloneable.Clone()

현재 인스턴스의 복사본인 새 개체를 만듭니다.

적용 대상

추가 정보