Private sub textbox1_keypress (Byval e as system.windows.forms.keypressEventArgs) Handles TextBox1.KeyPress
If isnumeric (TextBox1.text) = false kilbox ("can only be a number!") TextBox1.text = "" endiff
End Sub
OR:
Private sub textbox1_keypress (Byval e as system.windows.forms.keypressEventArgs) Handles TextBox1.KeyPress
DIM NUM AS STRING NUM = "0.123456789" if Num.indexof (E.Keychar) = -1 Then E.handled = True End IF
End Sub