0

Good Day to all,

Can anyone give me an idea on how I can select an item in ListView using Right Click mouse button? Any insight would be great.

Thanks

1
Contributor
1
Reply
3
Views
6 Years
Discussion Span
Last Post by romz
0

It took me a long time but i finally got it. Here is my code.

Private Sub lstRFC_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

    Dim LI As ListItem

    If Button = vbRightButton Then
    
        Set LI = lstRFC.HitTest(x, y)
        
        If Not LI Is Nothing Then
            
            Me.lstRFC.SelectedItem.Selected = False
          
            Set lstRFC.SelectedItem = LI
            
            PopupMenu popmnuListView
            
        End If

    End If

End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.