Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hie!


i Writing this code for numeric inout validation... but its not work


VB
If (e.KeyChar >= "48" And e.KeyChar <= "57" Or e.KeyChar = "8") Then
          MsgBox("hello")

      End If



anyone tell me what is wrong in this ? it will not generate any erro or not even any output?

so how to make validation for letters and numeric in vb.net 2005 please tell me
Posted
Updated 6-Jul-10 2:27am
v2

If ((e.KeyChar >= "48" And e.KeyChar <= "57") Or e.KeyChar = "8") Then
MsgBox("hello")
End If
 
Share this answer
 
VB
If (e.KeyCode >= "48" And e.KeyCode <= "57" Or e.KeyCode = "8") Then
           MsgBox(e.KeyCode)
       End If

KeyCode is used in VB.net :)
 
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