Tuesday, June 19, 2012

How to create a numeric only Text box

Add the following code in the textBox_KeyPress event:

If  (Not Char.IsNumber(e.KeyChar) And (e.KeyChar <> ChrW(Keys.Back))) Then

      e.Handled = True
End If

No comments:

Post a Comment