How to use 123-4567890-1011123 this Format in TEXT Box Auto Typing

Maybe …
1-Try to put your code in on text changed
2- Create a variable to receive the text box content, without the hyphens.
3- Create a variable to receive the size of the variable created above. (Size_without_hyphens)
4- Create a variable to receive the actual size of the textbox with the hyphens (size_textbox)
5- Compare the size of the variable without a hyphen with its limits (the first limit is greater than 3 and less than 10) and compare if the 2 variables with sizes (with and without hyphen) are different.
5.1- If true, make the variable with the size of the textbox with hyphens receive this variable size without a hyphen.
5.2- Change the content of the textbox: take the first 3 digits, join with the hyphen, and with the rest of the content of your textbox.
5.3- Place your cursor at the last position + 1
6-Then adjust to compare the next limits of the hyphens
7- Ceck the maximum size of the textbox content (as it was posted above )

5 Likes