See Also Example
Applies To
Line, shape
Description
Determines the width of a control's border.
Usage
[form.]{ line|shape}.BorderWidth[ = numericexpression ]
Remarks
The BorderWidth property settings can range from 1 to 8192, inclusive.
Use the BorderWidth and BorderStyle The following table shows the effect of BorderStyle settings on the BorderWidth property:
BorderStyle Effect on BorderWidth
0 BorderWidth setting is ignored.
1 to 5 The border width expands from the center of the border; the height and width of the control are measured from the center of the border.
6 The border width expands inward on the control from the outside of the border; the height and width of the control are measured from the outside of the border.
If BorderWidth is greater than 1, the only effective settings of BorderStyle are 1 (Solid), and 6 (Inside Solid).
Data Type
Integer
Help:
BorderStyle Property
DrawWidth Property
Height, Width Properties
Programmer's Guide:
Chapter 3, "Creating and Using Controls"
The example uses two combo boxes to select different widths and styles for the borders of a shape control. To try this example, paste the code into the Declarations section of a form that contains a shape control and one combo box. For the combo box, set Style = 2 and Index = 0 (to create a control array). Then press F5 and click the form.
Sub Form_Load ()
Combo1(0).Width = 1440 * 1.5
Load Combo1(1)
Combo1(1).Top = Combo1(0).Top + Combo1(0).Height * 1.5
Combo1(1).Visible = True
For I = 0 To 6
Combo1(0).AddItem "BorderStyle = " & I
Next I
For I = 1 To 10
Combo1(1).AddItem "BorderWidth = " & I
Next I
Combo1(0).ListIndex = 1
Combo1(1).ListIndex = 0
End Sub
Sub Combo1_Click (Index As Integer)
If Index = 0 Then
Shape1.BorderStyle = Combo1(0).ListIndex
Else
Shape1.BorderWidth = Combo1(1).ListIndex + 1
End If
End Sub