Solved

capture alt - mouse click event

Posted on 2008-10-29
2
1,426 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It started not too long ago. It was at first annoying. My keystrokes seemed to be randomly generated, not the ones I typed on the keyboard. For some reason this only happened in certain applications (especially browsers such as IE11, Firefox and Chr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now