Visual Basic Reference

DrawWidth Property Example

This example draws a gradually thickening line across a form. 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.
   DrawWidth = 1   ' Set starting pen width.
   PSet (0, ScaleHeight / 2)   ' Set starting point.
   ForeColor = QBColor(5)   ' Set pen color.
   For I = 1 To 100 Step 10   ' Set up loop.
      DrawWidth = I   ' Reset pen width.
      Line - Step(ScaleWidth / 10, 0)   ' Draw a line.
   Next I
End Sub
Show: