ListBox.ColumnFromXY

From Real Software Documentation

Jump to: navigation, search
Method
ListBox.ColumnFromXY ( X as Integer,Y as Integer ) As Integer

Returns the column index from the passed mouse x,y pixel coordinates.

The parameters are relative to the top, left corner of the Listbox.

Examples

This code in the DoubleClick event of a ListBox obtains the indexes of the cell that was double-clicked.

Dim row,column as Integer
row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
column=Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left,System.MouseY - Me.Top - Self.Top)
MsgBox "You double-clicked in cell "+Str(row)+", "+Str(column)
Personal tools