RectangleShape.CornerRadius (Propiedad)

Obtiene o establece el intervalo de las esquinas de las formas del rectángulo redondeado y el cuadrado redondeadas.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
<BrowsableAttribute(True)> _
Public Property CornerRadius As Integer
[BrowsableAttribute(true)]
public int CornerRadius { get; set; }
[BrowsableAttribute(true)]
public:
property int CornerRadius {
    int get ();
    void set (int value);
}
[<BrowsableAttribute(true)>]
member CornerRadius : int with get, set
function get CornerRadius () : int
function set CornerRadius (value : int)

Valor de propiedad

Tipo: System.Int32
Integer que representa el radio.El valor predeterminado es 0, o cualquier intervalos.

Comentarios

el valor mínimo de CornerRadius es 0.Esto produce un rectángulo o un cuadrado sin esquinas redondeadas.El valor máximo es el alto o ancho (lo que sea más pequeño) de RectangleShape dividido por dos.para una forma cuadrada esto creará un círculo.

Ejemplos

El ejemplo siguiente se cambia CornerRadius de RectangleShape cuando se hace clic en RectangleShape .Este ejemplo requiere tener RectangleShape denominado RectangleShape1 en un formulario.

Private Sub RectangleShape1_Click(ByVal sender As System.Object,
 ByVal e As System.EventArgs) Handles RectangleShape1.Click
    Dim max As Integer
    ' Calculate the maximum radius.
    max = Math.Min(RectangleShape1.Height, RectangleShape1.Width) / 2
    ' Check whether the maximum radius has been reached.
    If RectangleShape1.CornerRadius = max Then
        ' Reset the radius to 0.
        RectangleShape1.CornerRadius = 0
    Else
        ' Increase the radius.
        RectangleShape1.CornerRadius =
          RectangleShape1.CornerRadius + 15
    End If
End Sub
private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
    int max;
    // Calculate the maximum radius.
    max = Math.Min(rectangleShape1.Height, rectangleShape1.Width) / 2;
    // Check whether the maximum radius has been reached.
    if (rectangleShape1.CornerRadius == max)
    // Reset the radius to 0.
    {
        rectangleShape1.CornerRadius = 0;
    }
    else
    {
        // Increase the radius.
        rectangleShape1.CornerRadius = rectangleShape1.CornerRadius + 15;
    }
}

Seguridad de .NET Framework

Vea también

Referencia

RectangleShape Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Introducción a los controles de líneas y formas (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)