ScrollableControl.DockPaddingEdges Clase

Definición

Determina el relleno de los bordes en controles acoplados.Determines the border padding for docked controls.

public: ref class ScrollableControl::DockPaddingEdges : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ScrollableControl/DockPaddingEdgesConverter))]
public class ScrollableControl.DockPaddingEdges : ICloneable
type ScrollableControl.DockPaddingEdges = class
    interface ICloneable
Public Class ScrollableControl.DockPaddingEdges
Implements ICloneable
Herencia
ScrollableControl.DockPaddingEdges
Atributos
Implementaciones

Ejemplos

En el ejemplo de código siguiente se usa la clase derivada, Panel.The following code example uses the derived class, Panel. En el ejemplo se acopla un botón en un control de panel y se recorren las propiedades ScrollableControl.DockPaddingEdges, estableciendo cada uno individualmente en el clic del botón.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. Este código requiere que se haya creado una instancia de un control Panel y un Button en un formulario, y que una variable miembro de nivel de clase denominada myCounter se haya declarado como un entero con signo de 32 bits.This code requires that a Panel control and a Button have been instantiated on a form, and a class-level member variable named myCounter has been declared as a 32-bit signed integer. Se debe llamar a este código en el evento Click del botón.This code should be called 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

Comentarios

La clase ScrollableControl.DockPaddingEdges crea un margen en un borde determinado o en todos los bordes de un control acoplado.The ScrollableControl.DockPaddingEdges class creates a margin on a given edge or all edges of a docked control. Puede establecer el ancho de este margen para cada borde individual estableciendo las siguientes propiedades: Bottom, Top, Left, Right.You can set the width of this margin for each individual edge by setting the following properties: Bottom, Top, Left, Right. Como alternativa, puede establecer todos los bordes en el mismo ancho simultáneamente estableciendo la propiedad All.Alternatively, you can set all the edges to the same width simultaneously by setting the All property. Si el tamaño del control es demasiado grande para su contenedor, el control cambiará de tamaño para ajustarse al contenedor, menos el ancho del margen especificado.If the size of the control is too large for its container, the control will be resized to fit in the container, minus the specified margin width.

Propiedades

All

Obtiene o establece el ancho del relleno de todos los bordes de un control acoplado.Gets or sets the padding width for all edges of a docked control.

Bottom

Obtiene o establece el ancho del relleno del borde inferior de un control acoplado.Gets or sets the padding width for the bottom edge of a docked control.

Left

Obtiene o establece el ancho del relleno del borde izquierdo de un control acoplado.Gets or sets the padding width for the left edge of a docked control.

Right

Obtiene o establece el ancho del relleno del borde derecho de un control acoplado.Gets or sets the padding width for the right edge of a docked control.

Top

Obtiene o establece el ancho del relleno del borde superior de un control acoplado.Gets or sets the padding width for the top edge of a docked control.

Métodos

Equals(Object)

Determina si el objeto especificado es igual al objeto ScrollableControl.DockPaddingEdges actual.Determines whether the specified object is equal to the current ScrollableControl.DockPaddingEdges object.

GetHashCode()

Actúa como función hash para un tipo concreto.Serves as a hash function for a particular type.

GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.Creates a shallow copy of the current Object.

(Heredado de Object)
ToString()

Devuelve una cadena vacía.Returns an empty string.

Implementaciones de interfaz explícitas

ICloneable.Clone()

Crea un nuevo objeto copiado de la instancia actual.Creates a new object that is a copy of the current instance.

Se aplica a

Consulte también: