ComponentOne True DBGrid Pro 8
OwnerDrawCellPrint Event

 

Object Reference> True DBGrid Events> OwnerDrawCellPrint Event

OwnerDrawCellPrint Event

The OwnerDrawCellPrint event occurs just before the cell specified by the Bookmark, Col, and Split arguments is to be printed.

Syntax

TDBGrid_OwnerDrawCellPrint (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)

Event applies to TDBGrid control.

Arguments

hDC is a handle to the printer 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 printing of the cell. Set it to False to indicate that the control should print the cell instead.

Remarks

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 printer device context using standard Windows GDI calls. Note that this is an enhanced metafile device context, so some operations (such as BitBlt) are not available.

Note

Since the mapping mode of the printer device context is MM_ISOTROPIC, not MM_TEXT, the Left, Top, Right, and Bottom arguments are in logical units, not Pixels. Use the UnitsPerInch property to determine the resolution of the printer device context.

See Also

TDBGrid Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback