Try this may this help you
Inside Class Declare this Function:
Public Sub txtValidation(ByVal e)
If (Asc(e.KeyChar)) < 65 Or (Asc(e.KeyChar)) > 90 And (Asc(e.KeyChar)) < 97 Or (Asc(e.KeyChar)) > 122 Then
If (Asc(e.KeyChar) <> 32) Then
e.Handled = True
End If
End If
If (Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub
The above will avoid you to enter Special Character but allow you to Input Alphabets Only.And the Below given function will avoid you to enter Special Characters but allow you to Enter Numbers only
Public Sub txtNumberValidation(ByVal e)
If (Asc(e.KeyChar) < 48) Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
e.Handled = True
End If
If (Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub
Call this Function from your Class to your Form In the Keypress event of your TextBoxes if having Problem follow
this Link [
^]
I have used ASCII codes to detect the Entered Value.Research on it You Will definitely get your Required Solution.Try it