From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

ListBox.InvalidateCell(row as Integer, column as Integer)

New in 5.5

Supported for all project types and targets.

Redraws the specified cell "from scratch" rather than using the data in the internal buffer.


row and column are zero-based. If you pass a -1 as the row or column parameter, it will redraw the specified entire row or column, i.e., Invalidate(2, -1) redraws row number 2. The CellBackgroundPaint and CellTextPaint events execute when InvalidateCell is called.

InvalidateCell should be necessary only if you are using a custom storage mechanism for your ListBox data. If the contents of the ListBox are stored in the ListBox cells, the ListBox will update automatically as needed.

This method doesn't have a high overhead if used unnecessarily since nothing will happen if the specified cell is not visible.


The following example redraws the specified cell.

Listbox1.InvalidateCell(1, 0)