473,394 Members | 1,893 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,394 software developers and data experts.

How to tell if Ctrl is pressed ...?

Du
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
Nov 16 '05 #1
2 7000
if (System.Windows.Control.ModifierKeys & Keys.Control == Keys.Control)
{
// Control is pressed
}

-vJ
"Du" <vi*******@hotmail.com> wrote in message
news:ms********************@rogers.com...
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

Nov 16 '05 #2
Du
Thanks, that's exactly what i need!
"Vijaye Raji" <no************@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
if (System.Windows.Control.ModifierKeys & Keys.Control == Keys.Control)
{
// Control is pressed
}

-vJ
"Du" <vi*******@hotmail.com> wrote in message
news:ms********************@rogers.com...
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


Nov 16 '05 #3

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

Similar topics

3
by: Mr. x | last post by:
Hello, I want to capture the event when the <ctrl> key is pressed. How can I do that ? Thanks :)
10
by: chirs | last post by:
I have a code to disable ctrl-v (paste) on the 2nd box. The problem is that when I type ctrl-v, the text shows, then disappear after I release ctrl-v. How can I make it not to show in the box. In...
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...
1
by: Pedro Graca | last post by:
Well ... I've been using Windows for a long time before I switched to Linux. I'm very used to type CTRL-ALT-DEL everytime I'm leaving my computer or arriving to it. It's hapenned _twice_ (in the...
3
by: Stefan | last post by:
Hy, i have an app and i must disable this combination: ALT+F4; CTRL+ALT+DEL; CTRL+ESC;ALT+TAB like this: i find something on Internet and i can block ALT+F4 protected override...
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?
2
by: active | last post by:
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...
5
by: Sharon | last post by:
I’m using the DataGrid control. The DataGrid allow select all by clicking on CTRL+A keys. I need to catch this keys event, so I tried using the KeyDown event, but only when the CTRL is pressed I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.