Object Reference > True DBGrid Events > OwnerDrawCell Event |
The OwnerDrawCell event occurs just before the cell specified by the Bookmark, Col, and Split arguments is to be painted.
TDBGrid_OwnerDrawCell (ByVal hDC As Long, ByVal Bookmark As Variant, ByVal Split as Integer, ByVal Col As Integer, ByVal Left As Integer, ByVal Top As Integer, ByVal Right As Integer, ByVal Bottom As Integer, Done As Integer)
hDC is a handle to the control's device context, which is required by all Windows GDI calls.
Bookmark is a variant that uniquely identifies the row to be painted.
Split is an integer that identifies the current split.
Col is an integer that identifies the column to be painted.
Left is an integer that indicates the left coordinate of the cell to be painted.
Top is an integer that indicates the top coordinate of the cell to be painted.
Right is an integer that indicates the right coordinate of the cell to be painted.
Bottom is an integer that indicates the bottom coordinate of the cell to be painted.
Done is an integer that should be set to True to indicate that the event did in fact handle the drawing of the cell. Set it to False to indicate that the control should draw the cell instead.
This event is only fired for columns in which the OwnerDraw property is set to True.
You can use this event to customize the appearance of individual cells by drawing directly to the grid's device context using standard Windows GDI calls.
The Left, Top, Right, and Bottom arguments are supplied in pixels so that they can be used directly in GDI calls.