Results 1 to 15 of 15

Thread: Backspace button ascii?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176

    Backspace button ascii?

    what is it? :-)

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    vbKeyBack

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    Ascii code I think its 8.

  4. #4
    New Member pari's Avatar
    Join Date
    Dec 2001
    Location
    on earth
    Posts
    13
    Hi!
    Yes its ascii code is 8
    here is a code for finding ascii code for any keypress

    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    MsgBox KeyCode
    End Sub


    try it
    pari

  5. #5
    DaoK
    Guest
    Here is all ASCII code with DESCRIPTIONS : http://www.bbsinc.com/iso8859.html

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Thumbs up

    Nice reference link DaoK!

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176
    thank you guys!

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Guess....i have wooden shoes, in my free time i sell tulips and I live in a huge windmill...
    Posts
    176
    1 more stupid question and i can work on, how can i limit a textbox to, let's say 3 chars?

  9. #9
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Originally posted by pari
    Hi!
    Yes its ascii code is 8
    here is a code for finding ascii code for any keypress

    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    MsgBox KeyCode
    End Sub


    try it
    pari
    that just displays key codes not ascii codes,

    from memory it is

    Private Sub Text1_KeyPress(KeyAscii As Integer, Shift As Integer)
    MsgBox KeyAscii
    End Sub


  10. #10
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Set the "MaxLength" property of the textbox to 3 like this:

    VB Code:
    1. Text1.MaxLength = 3
    Baaaaaaaaah

  11. #11
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    that's the best way, or u could add handling on the keypress.....


  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    If you are going to limit the text length at the control level, then you need to code both the KeyPress for keyboard input, and the change event for pasted input. abdul has the easiest suggestion however. If you just set that MaxLength property at design time, then you don't have to worry about either the Change or the KeyPress event. The disadvantage to that is you can't throw a message box or something at the user telling them they have reached the MaxLength.

  13. #13
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    try this if you want to do what hack says:

    VB Code:
    1. Private Sub Text1_KeyPress(KeyAscii As Integer)
    2. If Len(Text1) = 3 And KeyAscii <> vbKeyBack Then
    3.     KeyAscii = 0
    4.     MsgBox "You have reached the maximum length :)"
    5.     Exit Sub
    6. End If
    7. End Sub


  14. #14
    DaoK
    Guest
    Here is a trick I have when I program when I do not have Internet and I need to know an ASCII number.

    Here is the code :

    VB Code:
    1. Private Sub Form_Load()
    2. For i = 0 To 255
    3.     List1.AddItem ("->" & Format(i, "000") & " = " & Chr(i))
    4. Next
    5. End Sub

    Just add a Listbox and here you go

  15. #15
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    that won't tell you the ascii key for backspace

    if anything, you just put in the keypress event

    debug.print keyascii

    then when you know what key you pressed e.g. backspace, and you find out its ascii code

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