Shape.BorderWidth 属性

获取或设置 line 或 shape 控件的边框的宽度。

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

语法

声明
<BrowsableAttribute(True)> _
Public Overridable Property BorderWidth As Integer
[BrowsableAttribute(true)]
public virtual int BorderWidth { get; set; }
[BrowsableAttribute(true)]
public:
virtual property int BorderWidth {
    int get ();
    void set (int value);
}
[<BrowsableAttribute(true)>]
abstract BorderWidth : int with get, set
[<BrowsableAttribute(true)>]
override BorderWidth : int with get, set
function get BorderWidth () : int
function set BorderWidth (value : int)

属性值

类型:System.Int32
表示在像素的 Integer 边框宽度。默认值为 1。

备注

LineShape 控件, BorderWidth 该行的粗细。

OvalShapeRectangleShape 控件, BorderWidth 表示形状的外边缘的粗细。

示例

下面的示例演示如何设置 BorderColorBorderStyle和 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)