hi guys ! i want to set a focus using backspace keyascii in a maskedtext box so that when i press backspace the focus moves to the other text box or maskedtextbox, but when i press backspace and maskedtextbox is empty with length "5" the focus donot move to the other textbox. Here is my code, Help Please ! Thanks in Advance :)
Private Sub mskMobile1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles mskMobile1.KeyPress
Dim Count As Integer
Dim keyAsscii As Integer
keyAsscii = Asc(e.KeyChar)
Count = Len(mskMobile1.Text)
If keyAsscii = Keys.Enter Then
mskMobile2.Focus()
ElseIf keyAsscii = Keys.Back And Count = 5 Then
txtContactName.Focus()
End If
End Sub