Private Sub txtusr_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtusr.KeyPress If (e.KeyChar >= Chr(32) And e.KeyChar <= Chr(63)) Or (e.KeyChar >= Chr(91) And e.KeyChar <= Chr(94)) Or (e.KeyChar = Chr(96)) Or (e.KeyChar >= Chr(123) And e.KeyChar <= Chr(126)) Then e.Handled = True End If End Sub