Export (0) Print
Expand All

Visual Basic Reference

DrawStyle Property Example

This example draws seven lines across a form, with each line displaying a different DrawStyle property. (If you set AutoRedraw = True, the form accumulates a new set of lines each time you resize it and then click it.) To try this example, paste the code into the Declarations section of a form, and then press F5 and click the form.

Private Sub Form_Click ()
   Dim I   ' Declare variable.
   ScaleHeight = 8   ' Divide height by 8.
   For I = 0 To 6
      DrawStyle = I   ' Change style.
      Line (0, I + 1) - (ScaleWidth, I + 1)   ' Draw new line.
   Next I
End Sub
Show:
© 2015 Microsoft