Proprietà SimpleShape.BorderWidth
Ottiene o imposta la larghezza del bordo del controllo Shape.
Spazio dei nomi: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintassi
'Dichiarazione
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)
Valore proprietà
Tipo: System.Int32
Integer rappresentazione della larghezza del bordo in pixel.il valore predefinito è 1.
Note
per OvalShape o RectangleShape controllare, BorderWidth rappresenta lo spessore dei bordi esterni della forma.
Esempi
Nell'esempio seguente viene illustrato come impostare BorderColor, BorderStylee BorderWidth proprietà di OvalShape controllare, viene visualizzato un ovale) con un bordo tratteggiato rosso da 3 pixel di larghezza.
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);
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.VisualBasic.PowerPacks
Altre risorse
Introduzione ai controlli Line e Shape (Visual Studio)
Procedura: disegnare linee con il controllo LineShape (Visual Studio)
Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)