Specifies the cell's owner draw handler.
![]() | Type | Description | ||
| Item as Variant | A long value that indicates the item's handle. | |||
| ColIndex as Variant | A long expression that indicates the column's index or the cell's handle ( in case that the Item parameter is missing or if it is 0 ). A string expression that indicates the column's caption. | |||
| IOwnerDrawHandler | An object that implements the IOwnerDrawHandler interface. |
Use the CellOwnerDraw property to paint yourself the cell. The CellOwnerDraw property specifies whether the user is responsible for painting the cell. By default, the CellOwnerDraw property is nothing, and so the control does the painting. Using the notification interfaces is faster than using events. For instance, let's say that we need cells where for some values we need to get displayed other things. Use the Def(exCellOwneDraw) property to assign an owner draw object for the entire column. Use the AdjustSearchColumn property to specify whether a hidden column displays data in the control's label area.
How can I paint myself the control's label area? The idea is to let the control having an owner draw hidden column that's displayed in the control's label area.
You need the followings:
So, a VB sample may look as follows:
