Input Mask
In the InputMask
property of your textBox, include the 000.000.000-00
mask, like this:
seuTextBox.InputMask = "000.000.000-00"
The mask can receive the characters:
-
0 - Digit (0 to 9, required entry, plus and minus signs are not allowed).
-
9 - Digit or space (non-mandatory input, plus and minus signs are not allowed).
-
# - Digit or space (not required entry, spaces are displayed as white space in edit mode, but whitespace is removed when data is saved; plus and minus are allowed).
-
L - Letter (A to Z, required entry).
-
? - Letter (A to Z, optional entry).
-
A - Letter or digit (required entry).
-
a - Letter or digit (optional entry).
-
& - Any character or space (required entry).
-
C - Any character or a space (optional entry).
See also
For more information, more character options (in addition to those listed above), and to find the complete documentation, go to MSDN page .