Hello,
it’ probably a very easy question but
I started to tackle ListBoxes.
I went thru much of the documentation and tried different approaches but I cannot get a column number.
I have a very simple ListBox made of 1 row and 4 columns, wherever I click I always get -1,-1 as a response.
How can I identify each cell (and not just get a -1,-1) so as to perform actions in it?
Thank you
I got it from an example:
[Var xValue As Integer
xValue = System.MouseX - Me.Left - Self.Left // Calculate current mouse position relative to top left of ListBox
Var yValue As Integer
yValue = System.MouseY - Me.Top - Self.Top // Calculate current mouse position relative to top of ListBox.
Var row, column As Integer
row = Me.RowFromXY(xValue, yValue)
column=Me.ColumnFromXY(xValue, yValue)
MessageBox("You double-clicked in cell " + row.ToString + ", " + column.ToString)]
Wherever I double click I get -1,-1 in the MessageBox
var x as integer=self.mouseX - self.left - me.left
var y as integer=self.mouseY - self.top - me.top
var row as integer=Me.RowFromXY(x, y)
var column as integer=ColumnFromXY(x, y)
is correct
if you get -1, -1 your listbox is empty
This is valid (not -1) only for existing rows
Use System.DebugLog , not a message box to see values involving event especially for mouse events