Code:
Public Class Form1 Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If (Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57) Or Asc(e.KeyChar) = 8 Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
End Class
Video tutorial:
No comments:
Post a Comment