Solved

capture alt - mouse click event

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

19 Experts available now in Live!

Get 1:1 Help Now