Shape.BorderWidth-Eigenschaft

Ruft ab oder legt die Breite des Rahmens eines Formsteuerelements Linien-oder fest.

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

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Overridable Property BorderWidth As Integer
[BrowsableAttribute(true)]
public virtual int BorderWidth { get; set; }
[BrowsableAttribute(true)]
public:
virtual property int BorderWidth {
    int get ();
    void set (int value);
}
[<BrowsableAttribute(true)>]
abstract BorderWidth : int with get, set
[<BrowsableAttribute(true)>]
override BorderWidth : int with get, set
function get BorderWidth () : int
function set BorderWidth (value : int)

Eigenschaftswert

Typ: System.Int32
Integer , der die Rahmenbreite in Pixel darstellt.Der Standardwert ist 1.

Hinweise

Für ein LineShape-Steuerelement stellt BorderWidth die Stärke der Linie dar.

Für ein OvalShape oder RectangleShape-Steuerelement stellt BorderWidth die Stärke der Ränder der Form dar.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie BorderColor, BorderStyleund BorderWidth-Eigenschaften für ein OvalShape-Steuerelement festgelegt und ein Oval mit einem roten breiten Graugelber Breitflügelspanner mit 3 Pixel anzeigt.

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

.NET Framework-Sicherheit

Siehe auch

Referenz

Shape Klasse

Microsoft.VisualBasic.PowerPacks-Namespace

Weitere Ressourcen

Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)

Gewusst wie: Zeichnen von Formen mit dem OvalShape-Steuerelement und dem RectangleShape-Steuerelement (Visual Studio)

Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)