Results 1 to 4 of 4

Thread: How to detect a keypress in vb2010

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2009
    Posts
    21

    How to detect a keypress in vb2010

    I would like the program to detect a key press and then report that key to a MsgBox

    I have the code for the message box thats easy, and I have
    Any help is welcome

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: How to detect a keypress in vb2010

    Handle the KeyPress of the appropriate control. If it's the form, make sure you set the KeyPreview property to True, so it raises keyboard events no matter what control has focus.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2009
    Posts
    21

    Re: How to detect a keypress in vb2010

    Thank you for the tid bit, I didn't change that proerty, but I want it to be able to tell what key is pressed, such as


  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2009
    Posts
    21

    Re: How to detect a keypress in vb2010

    Found the code, I am using Asc(e.keychar())

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width