How do you write a MaskedTextbox validation for a phone number which has to contain 10 Numbers.
eng. (999) 000-0000
If the phone number does not contain 10 numbers. The program will prompt the user to enter a correct phone number.
Try this, I think it will help.
http://www.codeproject.com/Tips/666932/Using-Masked-TextBox-in-NET
There is a MaskedTextBox
control that you can utilize. It's the same as a regular text box except for you need to set the Mask
property.
You might look at a mask such as "(000) 000-0000"
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.