Results 1 to 5 of 5

Thread: Keyboard Keycodes

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Unhappy

    I want to setup a program that recognizes when a certain key is pressed, then have it changed and sent to a text box. I have seen and example on this site but it only has the keycodes for the up, down, left, and right arrow keys. Is there a place I can go to see the keycodes for all the keys? Thanx in advance

  2. #2
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    Hi.

    Sorry, I can't quite understand what you mean.

    Do you want the KeyCodes for all keys? That can be found if you go to MSDN or your Help files and search for "KeyCode Constants".

    But what is it that you want to have changed? And what appears in the text box?

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Unhappy Keyboard Keycodes

    ok here is what I need. I want it so if you have two text boxes, if they were to put say the letter 'B' you push a button and in the second text box would say '123' ..something like that. Im not quite sure how to set it up though I new to all this. Something like

    If keycode #
    then textbox '123'
    else textbox ' '

    I know thats not code but its the general idea.
    Or even better have it so a command button isnt even needed and it changes AS its being typed. type a letter get instant change in bottom box...i guess it would look like its typing as you are. sorry if thats complicated. Thanx again

  4. #4
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    I still don't quite follow you, but try this
    Make a form with two text boxes (Text1 and Text2) .
    Erase their initial Text.

    then in Code:


    Private Sub Text1_Change()
    strKey = Mid(Text1.Text, Len(Text1.Text), 1)
    If strKey = "B" Then
    Text2.Text = "You Typed B"
    Else
    Text2.Text = ""
    End If


    End Sub


    I hope this is similar to what you wanted.

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    35

    Smile Keys

    that was what I was looking for, it works great thanx!

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