Numbers only!

EZCheeZe

Newcomer
Joined
Dec 12, 2002
Messages
7
Is there a way to make a text box only have numbers in it? Or if thats not possible, is there a way of determining if it is all numbers or not?
 
you can use this in the KeyPress event...
Visual Basic:
If Not e.KeyChar.IsDigit(e.KeyChar) Then
and this in the Validating event (in case they paste some text)
Visual Basic:
If Not IsNumeric(textbox1.Text) Then
 
Back
Top