怎么样去写一个listview右击事件?

来源:百度知道 编辑:UC知道 时间:2024/06/08 23:39:46
怎么样去写一个listview右击事件?

可以在listview的mousedown事件下写代码,如下:
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then '右击弹出你是好人的msgbox
MsgBox "你是个好人!"
End If
End Sub