I want to validate textbox with keyPress event. It should allow alphabets and "(" and ")" I have written code for alphabet check but don't know how to check for "(" and ")".
Private Sub txtBankName_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBankName.KeyPress
If Not (Asc(e.KeyChar) = 8) Then
If Not ((Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) <= 122) Or (Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 90) Or Asc(e.KeyChar) = 32) Then
e.KeyChar = ChrW(0)
e.Handled = True
End If
End If
End Sub