Ascertain CTRL+SHFT keys pressed during MouseDown event

P

phcmi

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
 
M

Marc Gravell

Look at the static Control.ModifierKeys property - and remember to
test bitwise appropriately - i.e.

bool shiftPressed = (Control.ModifierKeys & Keys.Shift) ==
Keys.Shift; // shift (and possibly others) pressed

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