Right click event from a ListView item

I want to handle Right click on a List view item. I tried to use the click event for the List view control and use the even args to determine the mouse button clicked. But the event args are always empty. Is there any other way to get the right click event 
Please advise.

Thanks


Answer this question

Right click event from a ListView item

  • ElliottNess

    Hi,

    You may work on the MouseDown even of the ListView control, 
    e.g. 

    Private Sub lsvBarcode_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lsvBarcode.MouseDown
            If e.Button = MouseButtons.Right Then
            ...
            End If
    End Sub


    Regards,

  • Tom PIC

    That works. Thanks a bunch!
  • Right click event from a ListView item