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

S

Steph.

Hi,

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

Thanks,

Steph.
 
M

Marc Gravell

Check the Control object's ModifierKeys (static) property, e.g.

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


Marc

Hi,

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

Thanks,

Steph.
 
M

Marc Gravell

Obviously, Keys.Control (not Keys.Shift) for your case! (clipboard
inheritence at work there folks, sorry...)

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top