Compartilhar via


Propriedade Shape.BorderWidth

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

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

Sintaxe

<BrowsableAttribute(True)> _
Public Overridable Property BorderWidth As Integer

Dim instance As Shape
Dim value As Integer

value = instance.BorderWidth

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

Valor de propriedade

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

Comentários

Para um LineShape controle, BorderWidth representa a espessura da linha.

Para um OvalShape ou RectangleShape controle, BorderWidth representa a espessura 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)