-1
首先,我已將this link的代碼複製到任何效果。我無法檢測Visual Studio 2015中的右鍵單擊事件
我正在嘗試處理左鍵單擊和右鍵單擊按鈕。左鍵點擊註冊並正確執行,右鍵點擊根本沒有效果。我相信相關代碼如下:
Dim Buttons As New Dictionary(Of Integer, Button)
...
' in a loop that creates each button
Dim B As New Button
AddHandler B.Click, AddressOf Button_MouseDown
Private Sub Button_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
'code to get uid
If e.Button = MouseButtons.Left Then
left_click(uid)
'this works
End If
If e.Button = MouseButtons.Right Then
right_click(uid)
'this doesn't
End If
這是它,謝謝! – coinich