Propriedade Shape.BorderStyle

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

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

Sintaxe

<BrowsableAttribute(True)> _
Public Property BorderStyle As DashStyle

Dim instance As Shape
Dim value As DashStyle

value = instance.BorderStyle

instance.BorderStyle = value
[BrowsableAttribute(true)]
public DashStyle BorderStyle { get; set; }
[BrowsableAttribute(true)]
public:
property DashStyle BorderStyle {
    DashStyle get ();
    void set (DashStyle value);
}
public function get BorderStyle () : DashStyle
public 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

Especificado valor quando você conjunto esta propriedade não é um 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 é conjunto para 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 conjunto 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 AsNew OvalShape
Dim canvas AsNew 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);

Permissões

Consulte também

Referência

Shape Classe

Membros Shape

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

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

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