DesktopListBox.CellPressed

From Xojo Documentation

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


DesktopListBox.CellPressed(Row as Integer, Column as Integer, X as Integer, Y as Integer) As Boolean

New in 2021r3

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 (DesktopListBox.TypeEditable) and then call the EditCellAt 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) = DesktopListBox.CellTypes.TextField
Me.EditCellAt(row, column)

Return True
End If