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
Public Overrides Property BorderWidth As Integer
Dim instance As SimpleShape
Dim value As Integer
value = instance.BorderWidth
instance.BorderWidth = value
public override int BorderWidth { get; set; }
public:
virtual property int BorderWidth {
int get () override;
void set (int value) override;
}
public override function get BorderWidth () : int
public override 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 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 que tem uma borda vermelha pontilhada 3 pixels de largura.
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
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)
EndSub
privatevoid 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);
}
Permissões
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.
Consulte também
Referência
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)