Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capture Numeric or Alphabetic character only
Message
From
07/08/2003 14:43:09
 
 
To
29/07/2003 18:23:07
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00814747
Message ID:
00817911
Views:
13
Put code in the textbox's KeyPress event and put some code like this:

If (KeyAscii > 57 Or KeyAscii < 48) And KeyAscii <> 127 And KeyAscii <> 46
And KeyAscii <> 8 Then
KeyAscii = 0
End If

Above code is for numeric only entry. Add/Remove different KeyAscii code check for your situation.

>Hi...., Does any one have idea how to format the textbox for input, or is there any function. My intention is to allow user to enter numeric key only for numeric data type such as mark or salary, and alphabetic for name only.
>The textbox mentioned here do not use data binding. (no database in use)
>
>
>Thanks.
It's "my" world. You're just living in it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform