Shape.BorderStyle-Eigenschaft
Ruft die Rahmenart für ein Steuerelement Zeilen oder Forms fest.
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: System.Drawing.Drawing2D.DashStyle
Ein DashStyle-Wert, der die Darstellung des Rahmens darstellt.Der Standardwert ist Solid.
Ausnahmen
Ausnahme | Bedingung |
---|---|
InvalidEnumArgumentException | Der angegebene Wert beim Festlegen dieser Eigenschaft DashStyle kein gültiger Wert ist. |
Hinweise
Für ein LineShape-Steuerelement stellt BorderStyle das Format der Zeile platzieren dar.
Für ein OvalShape oder RectangleShape-Steuerelement stellt BorderStyle das Format der Form selbst dar, wenn die BackStyle-Eigenschaft auf Transparentfestgelegt ist.Wenn die BackStyle-Eigenschaft auf Opaquefestgelegt ist, stellt BorderStyle das Format 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
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.
Siehe auch
Referenz
Microsoft.VisualBasic.PowerPacks-Namespace
Weitere Ressourcen
Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)
Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)