Connecting Tech Pros Worldwide Forums | Help | Site Map

CTRL Mouse Click

Kevin L
Guest
 
Posts: n/a
#1: Nov 20 '05
Is there a way to tell when a user, for example, Clicks the right mouse
button while also pressing the Ctrl Key?



Kirk
Guest
 
Posts: n/a
#2: Nov 20 '05

re: CTRL Mouse Click


Kevin,

you can use the keydown and keyup events to toggle a variable that tracks
the current state of your ctrl key (e.control). then check your state
variable on the mousedown or click events.
Make sure your form's keypreview property is set to true.

Kirk Graves


"Kevin L" <no_spam@not_real_email.com> wrote in message
news:u%23JyU3AjDHA.3212@tk2msftngp13.phx.gbl...[color=blue]
> Is there a way to tell when a user, for example, Clicks the right mouse
> button while also pressing the Ctrl Key?
>
>[/color]


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#3: Nov 20 '05

re: CTRL Mouse Click


"Kevin L" <no_spam@not_real_email.com> scripsit:[color=blue]
> Is there a way to tell when a user, for example, Clicks the right mouse
> button while also pressing the Ctrl Key?[/color]

You can check in the 'Click' event if the key is pressed:

\\\
If ((Control.ModifierKeys And Keys.Control) = Keys.Control Then
...
End If
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Closed Thread