ListBox.CellBackgroundPaint Event

The parameter g is a Graphics object that corresponds to the content area of the cell Row, Column. 0,0 is the upper left of the cell.

Syntax
result = CellBackgroundPaint( g, Row, Column )

Parameters
g | Graphics
Row | Integer
Column | Integer

Return Value
Result | Boolean

# Notes

Returns a Boolean.

True means the user has handled the background paint and no other processing is to be done with the background. In this case the user is responsible for all highlighting. False means the user wants REALbasic to help paint the background. REALbasic will overwrite your drawing on the row that needs to be highlighted. REALbasic will attempt to highlight the row or column as appropriate (according to the platform and the hierarchical style).

CellBackgroundPaint fires for every visible row in a ListBox, regardless of whether there is an actual row there or not. This enables you to implement the background paint event for the entire ListBox in a consistent way. For example, to do alternating row colors. Because of this, you need to check whether the current row is less than ListCount when accessing the row, for example with the Cell method.

Before CellBackgroundPaint fires, some drawing may have taken place. It isn't safe to assume that the background of the cell is white or that the selection hasn't already been drawn. If you need the background to be clear, you need to clear the background yourself and then return True.