Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

  1. Home >
  2. All Categories >
  3. Computers & Internet >
  4. Programming & Design >
  5. Resolved Question
xxxx1101xxxx xxxx1101...
Member since:
January 19, 2008
Total points:
719 (Level 2)

Resolved Question

Show me another »

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

what's the code/method for detecting a pressed key in visual c#
kryzchek79 by kryzchek...
Member since:
July 16, 2007
Total points:
6,750 (Level 5)

Best Answer - Chosen by Voters

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.
100% 1 Vote

There are currently no comments for this question.

Other Answers (1)

  • K A by K A
    Member since:
    April 09, 2008
    Total points:
    145 (Level 1)
    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
    0% 0 Votes

Answers International

Yahoo! does not evaluate or guarantee the accuracy of any Yahoo! Answers content. Click here for the Full Disclaimer.

Help us improve Yahoo! Answers. Send Feedback