ListBox.CellClick

From Xojo Documentation

Event


ListBox.CellClick(Row as Integer, Column as Integer, X as Integer, Y as Integer) As Boolean

Supported for all project types and targets.

The user has clicked on the Row, Column cell. Row and Column are zero-based.

The parameters X and Y are the x and y coordinates of the mouse click relative to the top-left corner of the cell that was clicked. X and Y are on the same scale of reference as the coordinates used by the Graphics property of the CellBackgroundPaint event.

Notes

To give the user the ability to edit the cell, change the CellType to Editable (ListBox.TypeEditable) and then call the EditCell method. The user will then get a focusing ring around the cell and the current text will become editable. When the user tabs out of the cell, the changes will be saved. You will get the CellAction event.

CellClick returns a Boolean. Returning True means that the event will not be processed further (i.e., editable cells won't be editable and ListBox selection won't change).

Example

This code makes a cell editable when it is clicked:

If column = 2 Then // Is this the editable column?
Me.ColumnTypeAt(column) = ListBox.CellTypes.TextField
Me.CellEditTextAt(row, column)

Return True
End If