TEXTBOX only digital input

xiaoxiao2021-03-06  53

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

转载请注明原文地址:https://www.9cbs.com/read-116209.html

New Post(0)