Solved

capture alt - mouse click event

Posted on 2008-10-29
2
1,433 Views
Last Modified: 2013-12-09
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
0
Comment
Question by:hotshottools
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 22834194
Only in your application?

Here is an example in VB.Net 2005 (or above) using a PictureBox:
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

0
 

Author Closing Comment

by:hotshottools
ID: 31511317
Thanks for the quick response
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question