Solved

capture alt - mouse click event

Posted on 2008-10-29
2
1,452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 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