i have listbox and when i leftclick on the item it get selected does any one know how would i can do same thing with rightclick and item get selected.
Printable View
i have listbox and when i leftclick on the item it get selected does any one know how would i can do same thing with rightclick and item get selected.
How about this? You simulate a leftclick when you press the right button :)
Code:Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
mouse_event 2, 0&, 0&, 0&, 0&
mouse_event 4, 0&, 0&, 0&, 0&
End If
End Sub