473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I tell if Ctrl is pressed in MouseDown

In VB6 I believe MouseDown had a Shift argument that told if Shift, Ctrl or
Alt was pressed.

How in VB.NET MouseDown do I determine if one of these keys is pressed?

I could increment a global variable in KeyDown and Decrement it on KeyUp but
I'm hoping I can simply access a system wide property.

Is there a simple way to determine in MouseDown if one of those 3 keys is
pressed??
Cal
Nov 20 '05 #1
2 6391
* " active" <ac****@REMOVEa-znet.com> scripsit:
In VB6 I believe MouseDown had a Shift argument that told if Shift, Ctrl or
Alt was pressed.

How in VB.NET MouseDown do I determine if one of these keys is pressed?

I could increment a global variable in KeyDown and Decrement it on KeyUp but
I'm hoping I can simply access a system wide property.

Is there a simple way to determine in MouseDown if one of those 3 keys is
pressed??


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

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Thanks that did it

Cal
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OE**************@TK2MSFTNGP11.phx.gbl...
* " active" <ac****@REMOVEa-znet.com> scripsit:
In VB6 I believe MouseDown had a Shift argument that told if Shift, Ctrl or Alt was pressed.

How in VB.NET MouseDown do I determine if one of these keys is pressed?

I could increment a global variable in KeyDown and Decrement it on KeyUp but I'm hoping I can simply access a system wide property.

Is there a simple way to determine in MouseDown if one of those 3 keys is pressed??


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

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: MLH | last post by:
I use a mouse-down procedure to trap right mouse clicks and CTRL-Right mouse clicks. Running the procedure must put honey or some other sticky substance into my keyboard because subsequent...
2
by: Boaz Ben-Porat | last post by:
Is there any way to determine if the CTRL key is pressed from a MouseDown event on a DataGrid ? TIA Boaz ben-Porat DataPharm a/s Denmark
3
by: Glen Hong | last post by:
I have set up a hotkey using RegisterHotKey API function for Ctrl-Tab. Firstly, I can rap this when Ctrl-Tab is pressed however if I want to add an addition hotkey how can I distinguish between...
3
by: MrNobody | last post by:
Say I want to do a specific action if the user holds down the CTRL key while clicking something in my UI- how can I determine if this key is currently pressed within the mouse event?
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
2
by: Du | last post by:
How to tell if the Ctrl key is pressed without being inside a keypress/keyup/keydown event? I want distinguish between a "click" and a "ctrl+click" on a button. any suggestion? thanks
4
by: active | last post by:
I can use Control.ModifierKeys to determine if a modifying key is pressed when executing MouseDown event, but how can I determine if an "M" was pressed?? Possible? Can't find a clue in...
7
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all When processing datagrid's MouseDown event, I need to know if Ctrl key is currently pressed. Is there any way to check this? It would help if I had keyUp and KeyDown events for Ctrl key...
1
by: phcmi | last post by:
Within a mousedown event, can you please show a code sample of how to ascertain whether the CTRL and/or ALT and/or SHIFT keyboard key is pressed? Thank you
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.