Поделиться через


SimpleShape.BorderWidth - свойство

Возвращает или задает ширину границы элемента управления формы.

Пространство имен:  Microsoft.VisualBasic.PowerPacks
Сборка:  Microsoft.VisualBasic.PowerPacks.Vs (в Microsoft.VisualBasic.PowerPacks.Vs.dll)

Синтаксис

'Декларация
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)

Значение свойства

Тип: System.Int32
Integer представляющее ширину границы в точках.Значение по умолчанию — 1.

Заметки

Для OvalShape OR RectangleShape элемент управления, BorderWidth представляет толщины внешних границ фигур.

Примеры

В следующем примере показано, как задать BorderColor" BorderStyleи BorderWidth свойства OvalShape элемент управления отображает овал, имеющий границу предоставленную точки красным цветом, 3 пикселей по ширине.

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

Безопасность платформы .NET Framework

См. также

Ссылки

SimpleShape Класс

Microsoft.VisualBasic.PowerPacks - пространство имен

Другие ресурсы

Знакомство с элементами управления Line и Shape (Visual Studio)

Пошаговое руководство. Изображение линий при помощи элемента управления LineShape (Visual Studio)

Пошаговое руководство. Рисование фигур при помощи элементов управления OvalShape и RectangleShape (Visual Studio)