Hello,
I'm trying to automatically add a hyphen at a certain position in the textbox whenever i type something new, but I'm unable to delete the second hyphen if I want to edit what I've typed in the textbox. Can you guys help me with this one ?
Code:
Private Sub prof_telephone_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prof_telephone.TextChanged
If prof_telephone.TextLength = 2 Then
prof_telephone.AppendText(" - ")
End If
If prof_telephone.TextLength = 8 Then
prof_telephone.AppendText(" ")
End If
End Sub
Thank you in advance.
I'm trying to automatically add a hyphen at a certain position in the textbox whenever i type something new, but I'm unable to delete the second hyphen if I want to edit what I've typed in the textbox. Can you guys help me with this one ?
Code:
Private Sub prof_telephone_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prof_telephone.TextChanged
If prof_telephone.TextLength = 2 Then
prof_telephone.AppendText(" - ")
End If
If prof_telephone.TextLength = 8 Then
prof_telephone.AppendText(" ")
End If
End Sub
Thank you in advance.