Jan 25, 2003 #1 E EZCheeZe Member 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?
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?
Jan 25, 2003 #2 Robby Moderator Joined Nov 17, 2002 Messages 3,461 Location Montreal, Ca. User Rank *Expert* you can use this in the KeyPress event... Code: If Not e.KeyChar.IsDigit(e.KeyChar) Then and this in the Validating event (in case they paste some text) Code: If Not IsNumeric(textbox1.Text) Then
you can use this in the KeyPress event... Code: If Not e.KeyChar.IsDigit(e.KeyChar) Then and this in the Validating event (in case they paste some text) Code: If Not IsNumeric(textbox1.Text) Then