Freigeben über


Shape.BorderStyle-Eigenschaft

Ruft ab oder legt die Rahmenart für ein Steuerelement Form oder Linie.

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

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Property BorderStyle As DashStyle
[BrowsableAttribute(true)]
public DashStyle BorderStyle { get; set; }
[BrowsableAttribute(true)]
public:
property DashStyle BorderStyle {
    DashStyle get ();
    void set (DashStyle value);
}
[<BrowsableAttribute(true)>]
member BorderStyle : DashStyle with get, set
function get BorderStyle () : DashStyle 
function set BorderStyle (value : DashStyle)

Eigenschaftswert

Typ: DashStyle
Ein DashStyle Wert, der die Darstellung des Rahmens darstellt.Der Standardwert ist Solid.

Ausnahmen

Ausnahme Bedingung
InvalidEnumArgumentException

Beim Festlegen dieser Eigenschaft angegebene Wert ist kein gültiger DashStyle Wert.

Hinweise

Für ein LineShape -Steuerelement BorderStyle das Format der Zeile darstellt.

Für eine OvalShape oder RectangleShape -Steuerelement BorderStyle den Stil der Form selbst darstellt, wenn der BackStyle -Eigenschaftensatz auf Transparent. Wenn die BackStyle -Eigenschaftensatz auf Opaque, die BorderStyle den Stil der äußeren Kanten der Form darstellt.

Beispiele

Das folgende Beispiel zeigt die Vorgehensweise beim Festlegen der BorderColor, BorderStyle, und BorderWidth Eigenschaften für ein OvalShape -Steuerelement eine Ellipse mit einem gepunkteten Rand von 3 Pixel breit rot angezeigt.

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)