Custom Search
Your Ad Here
Latest News

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

  1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  2. If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
  3. Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
  4. e.Handled = True
  5. End If
  6. If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
  7. e.Handled = False
  8. End If
  9. End Sub

Currently have 0 comments:

Leave a Reply

Post a Comment