检查哪个鼠标按钮“上升”

时间:2011-04-01 22:40:56

标签: vb.net winforms visual-studio

好吧,我有一个鼠标按钮启动时的事件处理程序。我想检查哪个按钮(左或右)。这是函数定义:

 Private Sub PictureBox2_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseUp

我用过

    e.Button.Left()

尝试获取布尔值,但是我收到错误....

2 个答案:

答案 0 :(得分:3)

使用button property

If (e.Button = Windows.Forms.MouseButtons.Left) Then
    'Do Somthing
End If

答案 1 :(得分:1)