title: Textbox only accept digits, letters and back space; the 1st character entered for the textbox cannot be a digit
body: <p>I am working on this program and I have a problem that I cant figure out. </p>
  
  <p>So I have a textbox that  only accept digits, letters and back space; the 1st
  character entered for the textbox cannot be a digit; the length of textbox is at most 6. The textboxe will reject any invalid chars, including any extra chars or a digit
  entered as the first char for username.</p>
  
  <p>I have the following code for it, but it is not working and I can't figure out why. </p>
  
  <pre><code>Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
      Dim char1 As Char = e.KeyChar
      If (char1 &gt;= 48 AndAlso char1 &lt;= 57) Then
          If ((Me.txtUserName.Text.Length = 6) Or Not Me.txtUserName.SelectionStart) Then
              Interaction.Beep()
              e.Handled = True
          End If
      ElseIf ((char1 &gt;= 97 AndAlso char1 &lt;= 122 OrElse char1 &gt;= 65 AndAlso char1 &lt;= 90)) Then
          If (Me.txtUserName.Text.Length = 6) Then
              Interaction.Beep()
              e.Handled = True
          End If
      ElseIf (char1 &lt;&gt; 8) Then
          Interaction.Beep()
          e.Handled = True
      End If
  End Sub
  </code></pre>