Condividi tramite


Proprietà RectangleShape.CornerRadius

Ottiene o imposta il raggio per gli angoli del rettangolo arrotondato e delle forme arrotondate il quadrato.

Spazio dei nomi:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintassi

'Dichiarazione
<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)

Valore proprietà

Tipo: System.Int32
Integer rappresenta il raggio.l'impostazione predefinita è 0, o nessun raggi.

Note

il valore minimo di CornerRadius è 0.Ciò comporta un rettangolo o un quadrato senza angoli arrotondati.Il valore massimo è l'altezza o la larghezza (qualsiasi dimensioni inferiori) di RectangleShape diviso per due.Per una forma quadrata questo verrà creato un cerchio.

Esempi

Nell'esempio seguente viene modificato CornerRadius la proprietà di un oggetto RectangleShape quando RectangleShape viene fatto clic su.Questo esempio presuppone che l'utente abbia a RectangleShape RectangleShape1 denominato in un form.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

RectangleShape Classe

Spazio dei nomi Microsoft.VisualBasic.PowerPacks

Altre risorse

Introduzione ai controlli Line e Shape (Visual Studio)

Procedura: disegnare linee con il controllo LineShape (Visual Studio)

Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)