Key down events.

Discussion in 'C#' started by Timeaisis, Apr 11, 2008.

  1. Timeaisis

    Timeaisis New Member

    Joined:
    Apr 11, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    This is probably a stupid question, but I couldn't find it anywhere else.

    I know there is a way, but I'm new to the language...anyway.

    I'm trying to make it so that both a button press and the enter key will both call the same function, and I can get the button working find...but I don't know how to 'detect' if the enter key is down. I know of ways, but there must be something very simple that I'm overlooking...

    thankks for the help.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,351
    Likes Received:
    382
    Trophy Points:
    83
    As far as I know you don't need to be doing anything unless you have messed up with the keyboard events
     
  3. CyCloneNL

    CyCloneNL New Member

    Joined:
    May 8, 2008
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    0
    Look for the AcceptButton property of your form, if you set that to your button it will activate when the user presses the Enter key.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice