DrawWidth Property

See Also31Z60DB                 Example1GFBZNI>Low

Applies To

Form14TJ2LN, picture box31MYIWX, Printer objectCBQUDQ.


Determines the line width for output from graphics methodsAY3LGR.


{ [form.][picturebox.]|Printer.}DrawWidth[ = size ]


You can set DrawWidth to a value of 1 through 32,767.  This value represents the width of the line in pixels.  The default is 1, or 1 pixelZ40N3B wide.


Increase the value of this property to increase the width of the line.  If DrawWidth is greater than 1, DrawStyle4PNS0NQ property settings 1 through 4 produce a solid line (the DrawStyle property value isn't changed).  Setting DrawWidth to 1 allows DrawStyle to produce the results shown in the DrawStyle property table.

Data Type


See Also


Circle Method38E9WK

DrawMode Property2ZATBSD

DrawStyle Property4PNS0NQ

FillColor PropertyL2TW7M

FillStyle Property2N3S7OE

ForeColor Property1W9T6JQ


Programmer's Guide:

Chapter 15, "Creating Graphics for Applications"

DrawWidth Property Example

The example draws a gradually thickening line across a form.  To try this example, paste the code into the Declarations section of a form.  Then press F5 and click the form.

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