Właściwość SimpleShape.BorderWidth —
Pobiera lub ustawia szerokość obramowania formantu kształtu.
Przestrzeń nazw: Microsoft.VisualBasic.PowerPacks
Zestaw: Microsoft.VisualBasic.PowerPacks.Vs (w Microsoft.VisualBasic.PowerPacks.Vs.dll)
Składnia
'Deklaracja
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)
Wartość właściwości
Typ: Int32
Integer Reprezentujący szerokość obramowania w pikselach.Wartość domyślna to 1.
Uwagi
Dla OvalShape lub RectangleShape kontroli, BorderWidth reprezentuje grubość zewnętrznej krawędzi kształtu.
Przykłady
W poniższym przykładzie pokazano sposób ustawiania BorderColor, BorderStyle, i BorderWidth właściwości OvalShape kontroli wyświetlania elipsę zawierającej red kropkowaną ramkę, która jest 3 pikseli.
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);
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Używanie bibliotek pochodzących z częściowo zaufanego kodu.
Zobacz też
Informacje
Przestrzeń nazw Microsoft.VisualBasic.PowerPacks
Inne zasoby
Linie i kształty — Wprowadzenie do formantów (Visual Studio)
Porady: rysowanie linii za pomocą formantów LineShape (Visual Studio)
Porady: rysowanie kształtów za pomocą formantów OvalShape i RectangleShape (Visual Studio)