Propriedade Shape.BorderStyle

Obtém ou define o estilo de borda de um controle de forma ou linha.

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

Sintaxe

'Declaração
<BrowsableAttribute(True)> _
Public Property BorderStyle As DashStyle
[BrowsableAttribute(true)]
public DashStyle BorderStyle { get; set; }
[BrowsableAttribute(true)]
public:
property DashStyle BorderStyle {
    DashStyle get ();
    void set (DashStyle value);
}
[<BrowsableAttribute(true)>]
member BorderStyle : DashStyle with get, set
function get BorderStyle () : DashStyle
function set BorderStyle (value : DashStyle)

Valor de propriedade

Tipo: System.Drawing.Drawing2D.DashStyle
A DashStyle valor que representa a aparência da borda.O valor padrão é Solid.

Exceções

Exceção Condição
InvalidEnumArgumentException

O valor especificado quando você definir essa propriedade não é válido DashStyle valor.

Comentários

Para um LineShape controle, BorderStyle representa o estilo da linha.

Para um OvalShape ou RectangleShape controle, BorderStyle representa o estilo da própria forma quando o BackStyle propriedade estiver definida como Transparent.Quando o BackStyle propriedade estiver definida como Opaque, o BorderStyle representa o estilo 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 com uma borda pontilhada de 3 pixels de largura vermelho.

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

Shape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

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

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