Shape.BorderStyle 属性

获取或设置形状的边框样式或路由控件。

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

语法

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

属性值

类型:System.Drawing.Drawing2D.DashStyle
表示边框的外观的 DashStyle 值。默认值为 Solid。

异常

异常 条件
InvalidEnumArgumentException

指定值,当您将该属性时不是有效的 DashStyle 值。

备注

LineShape 控件, BorderStyle 该行的样式。

OvalShapeRectangleShape 控件,那么,当 BackStyle 属性设置为 Transparent时, BorderStyle 表示形状的样式。 当 BackStyle 属性设置为 Opaque时, BorderStyle 表示形状的外边缘的样式。

示例

下面的示例演示如何设置 BorderColor、 BorderStyle和 BorderWidth 属性 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)