Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

Deleting characters in a texbox

$
0
0
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.

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>