471,603 Members | 1,509 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How can I detect if the CTRL key is pressed when User click on a control ?

Hi,

A simple question : How can I detect if the CTRL key is pressed when User click on a control ?

Thanks,

Steph.
Jan 3 '06 #1
2 2399
Check the Control object's ModifierKeys (static) property, e.g.

if((Control.ModifierKeys & Keys.Shift) == Keys.Shift) {
// do something special
}
Marc

"Steph." <st***@nomail.com> wrote in message
news:en*************@TK2MSFTNGP15.phx.gbl...
Hi,

A simple question : How can I detect if the CTRL key is pressed when User
click on a control ?

Thanks,

Steph.
Jan 3 '06 #2
Obviously, Keys.Control (not Keys.Shift) for your case! (clipboard
inheritence at work there folks, sorry...)

Marc

"Marc Gravell" <mg******@rm.com> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
Check the Control object's ModifierKeys (static) property, e.g.

if((Control.ModifierKeys & Keys.Shift) == Keys.Shift) {
// do something special
}
Marc

"Steph." <st***@nomail.com> wrote in message
news:en*************@TK2MSFTNGP15.phx.gbl...
Hi,

A simple question : How can I detect if the CTRL key is pressed when User
click on a control ?

Thanks,

Steph.

Jan 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Scott Shaw | last post: by
4 posts views Thread by Tom | last post: by
2 posts views Thread by Justin | last post: by
17 posts views Thread by Kbalz | last post: by
7 posts views Thread by =?Utf-8?B?QWxleCBLLg==?= | last post: by
4 posts views Thread by vunet | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

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.