Check whether a modifier key (Ctrl/Alt/Shift) is currently in a pressed state.

To check whether a modifier key is currently in a pressed state use the static function Control. ModifierKeys

Example:

if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
{
   ..
}
Lastest update in May 2011, inital post in May 2011

Write a comment

I appreciate comments, suggestions, compliments etc. Unfortunately I have no time to reply to them. Useful input will be used for sure!