This following code just allowed you to entered numbers only (No alphabetics or any special characters
10/27/08
, Posted by Gregfox at 6:14 AM
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then e.Handled = True End If If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then e.Handled = False End If End Sub
Currently have 0 comments: