Hi.
If I want an EditText to add a "-" after the first two digits, while the user enters numbers:
for example:
typed EditText shows
1 1
2 12
3 12-3
4 12-34
5 12-345
6 12-3456
Sub EditText1_TextChanged (Old As String, New As String)
If Old.Length<New.Length Then
If Old.Length=2 Then
New=Old.SubString2(0,2) & "-"
EditText1.Text=New
EditText1.SelectionStart=3
End If
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.