Click here to Skip to main content
15,901,505 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how can i use key press function as if any key press or any particular key press from a keyboard by any user.
and how can i get char number as
enter=chr(13)
Posted

I'm a C# guy but here's my attempt at the VB solution.

Private Sub Text1_KeyPress(KeyAscii As Integer)
dim CharNum = KeyAscii
End Sub
 
Share this answer
 
v2
Comments
irfanansari 23-Dec-10 12:14pm    
PLEASE TELL ME HOW AND FROM WHERE I CAN ASCII CODE WHICH IS USE IN VB.NET
wizardzz 23-Dec-10 12:19pm    
I'll assume you are unaware that your Caps Lock is on, or your Shift key is stuck, otherwise your just a rude astird.

I believe the variable CharNum will contain the ASCII code, have you checked the value?
Here you go (Not only Enter...you can get any key values for any keys as shown in these examples)

Control.KeyPress Event[^]

Working with Key Board Events in VB.net Application[^]
 
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