Propriedade SimpleShape.BorderWidth

Obtém ou define a largura da borda do controle de forma.

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

Sintaxe

'Declaração
Public Overrides Property BorderWidth As Integer
public override int BorderWidth { get; set; }
public:
virtual property int BorderWidth {
    int get () override;
    void set (int value) override;
}
abstract BorderWidth : int with get, set
override BorderWidth : int with get, set
override function get BorderWidth () : int
override function set BorderWidth (value : int)

Valor de propriedade

Tipo: System.Int32
Um Integer que representa a largura da borda em pixels.O valor padrão é 1.

Comentários

Para um OvalShape ou RectangleShape controle, BorderWidth representa a espessura das bordas externas da forma.

Exemplos

O exemplo a seguir demonstra como definir o BorderColor, BorderStyle, e BorderWidth propriedades de um OvalShape controle, exibindo uma elipse que tem uma borda pontilhada vermelha que é de 3 pixels de largura.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim OvalShape1 As New OvalShape
    Dim canvas As New ShapeContainer
    ' Set the form as the parent of the ShapeContainer.
    canvas.Parent = Me
    ' Set the ShapeContainer as the parent of the OvalShape.
    OvalShape1.Parent = canvas
    ' Change the color of the border to red.
    OvalShape1.BorderColor = Color.Red
    ' Change the style of the border to dotted.
    OvalShape1.BorderStyle = Drawing2D.DashStyle.Dot
    ' Change the thickness of the border to 3 pixels.
    OvalShape1.BorderWidth = 3
    OvalShape1.Size = New Size(300, 200)
End Sub
private void form1_Load(System.Object sender, System.EventArgs e)
{
    OvalShape ovalShape1 = new OvalShape();
    ShapeContainer canvas = new ShapeContainer();
    // Set the form as the parent of the ShapeContainer.
    canvas.Parent = this;
    // Set the ShapeContainer as the parent of the OvalShape.
    ovalShape1.Parent = canvas;
    // Change the color of the border to red.
    ovalShape1.BorderColor = Color.Red;
    // Change the style of the border to dotted.
    ovalShape1.BorderStyle = System.Drawing.Drawing2D.DashStyle.Dot;
    // Change the thickness of the border to 3 pixels.
    ovalShape1.BorderWidth = 3;
    ovalShape1.Size = new Size(300, 200);
}

Segurança do .NET Framework

Consulte também

Referência

SimpleShape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

Como: desenhar linhas com o controle de LineShape (Visual Studio)

Como: desenhar formas com os controles de RectangleShape (Visual Studio) e o OvalShape