Detect whether capslock, scrolllock or numlock is active.

To detect whether capslock, scrolllock or numlock is currently active use the static function Control.IsKeyLocked

Valid are Keys.ScrollKeys.NumLock and Keys.CapsLock

The Keys enumeration can be found in System.Windows.Forms.Keys

Example:

If (Control.IsKeyLocked(Keys.CapsLock))
{
}

Leave a Reply

Your email address will not be published. Required fields are marked *