VB Code:
Private Const LB_ITEMFROMPOINT = &H1A9
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lIndex As Long
Dim lCoord As Long
If Button = vbRightButton Then
'Convert X, Y to Long coordinate fro lParam argument
'(Coordinate: HiWord=Y; LoWord=X)
lCoord = ((Y / Screen.TwipsPerPixelY) * &H10000) + (X / Screen.TwipsPerPixelX)
'Now find the list item that was clicked
lIndex = SendMessage(List1.hwnd, LB_ITEMFROMPOINT, 0&, ByVal lCoord)
'If success...
If lIndex >= 0 Then
'You now have the index of the item
List1.ListIndex = lIndex
MsgBox "You right clicked on " & List1.Text
End If
End If
End Sub