Solved

capture alt - mouse click event

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Obtain cell value using column ID in DataGrid using VB.NET 2 38
Expression Evaluater 3 46
MailAddress in vb 4 36
Open a link in vb.net 2 27
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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