Visual Basic Concepts
The DrawStyle property specifies whether the lines created with graphics methods are solid or have a broken pattern. The BorderStyle property of a shape control serves the same function as the DrawStyle property, but applies to a variety of objects.
Note The BorderStyle property of a shape control serves a different purpose and uses different settings from the BorderStyle property in other controls and in forms. The BorderStyle property of a shape or line control serves a different purpose and uses different settings from the BorderStyle property on other objects. For shape and line controls, the BorderStyle property works like the DrawStyle property as described in this section. For forms and other controls, the BorderStyle property determines whether the control or form has a border and if so, whether the border is fixed or sizable.
The inside solid style (DrawStyle or BorderStyle = 6) is nearly identical to the solid style. They both create a solid line. The difference between these settings becomes apparent when you use a wide line to draw a box or a shape control. In these cases, the solid style draws the line half inside and half outside the box or shape. The inside solid style draws the line entirely inside the box or shape. See "Drawing Boxes, " earlier in this chapter, to see how to draw a box.
The following procedure demonstrates all of the supported settings of the DrawStyle property by creating a loop in which the setting goes from 0 to 6, one step at a time. The results are shown in Figure 12.20.
Private Sub Form_Click ()
Dim I As Integer, Y As Long
For I = 0 To 6
DrawStyle = I
Y = (200 * I) + 1000
Line (200, Y)–(2400, Y)
Next I
End Sub
Figure 12.20 The effects of changing the DrawStyle property
For More Information See "DrawStyle Property" or "BorderStyle Property" in the Language Reference.