954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help: Highlight/Select an Item in List View using Right Click Button

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

romz
Newbie Poster
9 posts since May 2011
Reputation Points: 10
Solved Threads: 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
romz
Newbie Poster
9 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You