Friday, January 31, 2014

Not allowed special character in vb.net

 Private Sub txtto_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtto.KeyPress
        Dim ValidInputChar = "#$%^&*,;()[]+{}:'`<>?|~!\/"
        If ValidInputChar.Contains(e.KeyChar) Then
            e.KeyChar = Nothing
        End If
    End Sub