Hi all,
the code works fine excepted on the part that returns the Row #. The Row # is the one below the released" (MouseUp) location: if you have a 10 items long COntextualMenu, and click in Row 0 / release teh Mouse on the 10th item, the Text will fall - say - on Row 10 (or so), not on the clicked Row !
If I use the arrow key to choose the entry from the ContextualMenu, the filled Cell will be the clicked Row. (What I expect).
Idea ?
TIA.
ContextualMenuAction Event:
[code] //
// ContextualMenuAction: put the Contextual selected text into the Cell below the click
//
Dim ClickRow As Integer
Dim ClickColumn As Integer
// Get the clicked Cell location
ClickRow = Me.RowFromXY( System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
ClickColumn = Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - Self.Top)
If hitItem <> Nil Then
// Put the selected Name in the selected Cell
Me.Cell(ClickRow, ClickColumn) = hitItem.Text
End If
// Handled !
Return True[/code]
PS: ConstructContextualMenu is not involved here (it just set three items in the ContextualMenu).
Edit: the Listbox (0,0) is set at 20,60 (window); in case it matters.