Are you trying to get the Click_Row and Click_Cell when you pressed right click or when you press left click on a menu? Because you’re doing the latter here if you’re calling this in ContextualMenuAction which could mean that depending on where the menu is pressed you could end up off the listbox and thus get an answer of -1
If you want to read the Click_Row and Click_Cell of the cell you clicked on when opening the menu you should run the code inside ConstructContextualMenu then store those values (e.g. in listbox properties) if you want to use them later inside ContextualMenuAction. Then if you are reading them inside ConstructContextualMenu you use x and y passed into the event and don’t need to do all the maths with things like System.MouseX etc.
I activate the ContextualMenu (either right-click / MousePar two digits click / ctrl-left click) on a populated Row and want to Be able to edit it (or something else like delete the Row).
I will do after lunch. (after reading your answer) I may have underlooked the code in my other project
As Julian said, if you are in ConstructContextualMenu (or MouseDown), you just use RowFromXY and ColumnFromXY, using x and y that are passed automatically to the event. No need for System.MouseX/Y.
It seems that I do not checked (read) carefully enough the ConstructContextualMenu Event.
Conclusion:
a. I add two window properties (My_X and My_Y As integer)
b. In ConstructContextualMenu, I store X and Y into My_X and My_Y,
c. I use these properties with RowFromXY and ColumnFromXY.