FillStyle Property

See Also16L2BS0              Example433VBAA>Low

Applies To

Form14TJ2LN, grid2VGT0PT, picture box31MYIWX, Printer objectCBQUDQ, shape9JZFLA.


GridDetermines whether setting the Text property of a grid causes the value to appear in all selected cells.

All other controlsDetermines the pattern used to fill shape controls as well as circles and boxes created with the Circle and Line graphics methods.


{ [form.][control.]|Printer.}FillStyle[ = style ]


The FillStyle settings for a grid control are:

Setting          Description


0                   Single-Changing the Text property only affects the active cell.

1                   Repeat-Changing the Text property affects all selected cells.


The FillStyle settings for other controls are:

Setting          Description


0                   Solid

1                   (Default) Transparent

2                   Horizontal Line

3                   Vertical Line

4                   Upward Diagonal

5                   Downward Diagonal

6                   Cross

7                   Diagonal Cross



When FillStyle is 1 (Transparent), the FillColorL2TW7M property is ignored.

Data Type

IntegerDOKXHY (Enumerated)

See Also


BorderStyle Property43RNRL

Paint Event25UTDKO


Programmer's Guide:

Chapter 15, "Creating Graphics for Applications"

FillStyle Property Example

The example displays a circle on a form with random FillColors and FillStyles as you click the mouse button.  To try this example, paste the code into the Declarations section and then press F5 to run the program.

Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)

   FillColor = QBColor(Rnd * 15)         ' Choose random FillColor.

   FillStyle = Int(Rnd * 8)              ' Choose random FillStyle.

   Circle (X, Y), 250                    ' Draw a circle.

End Sub