Question : Problem: capture alt - mouse click event

How, in VB.NET can you capture a mouse clicking event while the control or alt key is pressed.

I would like to know when a users holds down the alt key and clicks the right mouse button

Answer : Problem: capture alt - mouse click event

Only in your application?

Here is an example in VB.Net 2005 (or above) using a PictureBox:
1:
2:
3:
4:
5:
6:
7:
8:
9:
Public Class Form1
 
    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
        If My.Computer.Keyboard.AltKeyDown AndAlso e.Button = Windows.Forms.MouseButtons.Right Then
            MessageBox.Show("Alt-RightClick")
        End If
    End Sub
 
End Class
Open in New Window Select All
Random Solutions  
 
programming4us programming4us