Propriedade RectangleShape.CornerRadius

Obtém ou define o RADIUS de cantos do retângulo arredondado e formas quadradas arredondadas.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxe

<BrowsableAttribute(True)> _
Public Property CornerRadius As Integer

Dim instance As RectangleShape
Dim value As Integer

value = instance.CornerRadius

instance.CornerRadius = value
[BrowsableAttribute(true)]
public int CornerRadius { get; set; }
[BrowsableAttribute(true)]
public:
property int CornerRadius {
    int get ();
    void set (int value);
}
public function get CornerRadius () : int
public function set CornerRadius (value : int)

Valor de propriedade

Tipo: System.Int32
An Integer representando o RADIUS. O padrão é 0 ou não RADIUS.

Comentários

O valor mínimo de CornerRadius é 0. Isso resultados em um retângulo ou quadrado sem cantos arredondados.O valor máximo é a altura ou largura (que for menor) do RectangleShape divididos por dois. Para uma forma quadrada isso criará um círculo.

Exemplos

O exemplo a seguir altera o CornerRadius de um RectangleShape Quando o RectangleShape é clicado. Este exemplo requer que você tenha um RectangleShape chamado RectangleShape1 em um formulário.

PrivateSub RectangleShape1_Click(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) Handles RectangleShape1.Click
    Dim max AsInteger    ' 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
    EndIfEndSub
privatevoid 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;
    }
}

Permissões

Consulte também

Referência

RectangleShape Classe

Membros RectangleShape

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

Introdução à linha e controles de forma (Visual Studio)

Como: Desenhar linhas com o Controlarar de LineShape (Visual Studio)

Como: Desenhar formas com a OvalShape e controles de RectangleShape (Visual Studio)