Udostępnij za pośrednictwem


Właściwość Shape.BorderColor —

Pobiera lub ustawia kolor obramowania formantu kształtu lub wiersza.

Przestrzeń nazw:  Microsoft.VisualBasic.PowerPacks
Zestaw:  Microsoft.VisualBasic.PowerPacks.Vs (w Microsoft.VisualBasic.PowerPacks.Vs.dll)

Składnia

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

Wartość właściwości

Typ: Color
Element Color struktury reprezentujący kolor obramowania kształtu lub wiersza.Wartość domyślna to wartość DefaultBorderColor.

Uwagi

Dla LineShape kontroli, BorderColor reprezentuje kolor linii.

Dla OvalShape lub RectangleShape kontroli, BorderColor reprezentuje kolor 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 elipsę z 3 szeroki red kropkowana piksel są wyświetlane.

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

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

Shape Klasa

Przestrzeń nazw Microsoft.VisualBasic.PowerPacks

Inne zasoby

Porady: rysowanie linii za pomocą formantów LineShape (Visual Studio)

Porady: rysowanie kształtów za pomocą formantów OvalShape i RectangleShape (Visual Studio)

Linie i kształty — Wprowadzenie do formantów (Visual Studio)