Shape.BorderColor 属性

获取或设置形状的边框的颜色或路由控件。

命名空间:  Microsoft.VisualBasic.PowerPacks
程序集:  Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

语法

声明
<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)

属性值

类型:System.Drawing.Color
表示形状或行的边框的颜色 Color 结构。默认为 DefaultBorderColor 的值。

备注

LineShape 控件, BorderColor 该行的颜色。

OvalShapeRectangleShape 控件, BorderColor 表示形状的外边缘的颜色。

示例

下面的示例演示如何设置 BorderColor、 BorderStyleBorderWidth 属性 OvalShape 控件的,宽显示椭圆形用一个 3 像素的红色虚线边框。

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 安全性

请参见

参考

Shape 类

Microsoft.VisualBasic.PowerPacks 命名空间

其他资源

如何:使用 LineShape 控件绘制直线 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控件绘制形状 (Visual Studio)

Line 和 Shape 控件简介 (Visual Studio)