Search code examples
c#winformskeyboarduser-input

Handle the KeyDown Event when ALT+KEY is Pressed


How do you handle a KeyDown event when the ALT key is pressed simultaneously with another key in .NET?


Solution

  • This is the code that finally Works

    if (e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z &&  e.Alt){
         //Do SomeThing
    }