SimpleShape.BorderWidth-Eigenschaft
Aktualisiert: November 2007
Ruft die Rahmenbreite eines Shape-Steuerelements ab oder legt diese fest.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
Public Overrides Property BorderWidth As Integer
'Usage
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)
Eigenschaftenwert
Typ: System.Int32
Integer , die die Rahmenbreite in Pixel darstellt. Der Standardwert ist 1.
Hinweise
Für ein OvalShape-Steuerelement oder RectangleShape-Steuerelement stellt BorderWidth die Stärke der äußeren Ränder der Form dar.
Beispiele
Im folgenden Beispiel wird veranschaulicht, wie die Eigenschaften BorderColor, BorderStyle und BorderWidth für ein OvalShape-Steuerelement festgelegt werden, das ein Oval mit einem 3 Pixel breiten roten, gestrichelten Rahmen darstellt.
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);
}
Berechtigungen
- 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
Einführung in das Line-Steuerelement und das Shape-Steuerelement (Visual Studio)
Gewusst wie: Zeichnen von Linien mit dem LineShape-Steuerelement (Visual Studio)