How do I detect keys pressed in C# (c++)?

Follow
  • Follow publicly
  • Follow privately
  • Unfollow
what's the code/method for detecting a pressed key in visual c#
Best Answer
You can simply handle the KeyDown event for a form or control. The KeyDown event receives the KeyEventArgs parameter, which allows to you to determine the key pressed by looking at e.KeyCode.
  • Rate
  • Comment

Other Answers (1)

  • K A answered 6 years ago
    each control in c# (windows forms) has keypress, keydown, keyup that you can trap
    if you want to do int form level then form has those as well,
    you basically just do the same with form

    Source(s):

    http://support.microsoft.com/kb/320584
    • Rate
    • Comment
  • Sign In 

    to add your answer

Who is following this question?

    %
    BEST ANSWERS
    Member Since:
    Points: Points: Level
    Total Answers:
    Points this week:
    Follow
     
    Unfollow
     
    Block
     
    Unblock