Click here to Skip to main content
16,020,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get ascii value from keycode in keyUp event of textbox?
Posted
Updated 7-Jun-10 20:39pm
v2

Chr(e.KeyCode) for retrieving the character.

If you want to retrieve the last typed character, use TextBox1.Text(TextBox1.TextLength-1)
 
Share this answer
 
Maybe this [^] class can help you.
 
Share this answer
 
k guys i got it

it go like this

Chr(e.keyCode)
 
Share this answer
 
Your best bet would be to use the KeyPress event handler and then convert the KeyChar i.e
AscW(e.KeyChar). Hope this helps

Happy Coding
 
Share this answer
 
k m getting ascii value from keycode
next step is to determine the index of keycode in text

i have used

TextBox1.Text.IndexOf(chr(e.keyCode)


but it gives index -1

I'm not able to determine position of current keycode
 
Share this answer
 
this will definitely work
=> Asc(e.KeyCode)

Regards
www.Masssoftech.blogspot.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900