Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Capture Numeric or Alphabetic character only
Message
 
 
À
29/07/2003 18:23:07
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00814747
Message ID:
00817911
Vues:
14
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform