Skip to the content

Masked Text Box

This control uses a mask to distinguish between proper and improper user input. For example: to force a user to fill out a date (e.g. a date of birth) in the masked text box a setting the property Mask to value of “90/90/0000” provides a text template for the user to type. Actual date value however should be validated by setting a regular expression validation.


Mask syntax:

The masked text box uses the standard Microsoft.NET MaskedTextProvider mask syntax (for full information see the .NET Framework SDK).

Mask Character Accepts Required?
0 Digit (0-9) Required
9 Digit (0-9) or space Optional
# Digit (0-9) or space Required
L Letter (a-z, A-Z) Required
? Letter (a-z, A-Z) Optional
& Any character Required
C Any character Optional
A Alphanumeric (0-9, a-z, A-Z) Required
a Alphanumeric (0-9, a-z, A-Z) Optional
. Decimal separator Required
, Group (thousands) separator Required
: Time separator Required
/ Date separator Required
$ Currency symbol Required

There is a few of other characters with special meaning:

Mask Character Meaning
All subsequent characters are converted to lower case
All subsequent characters are converted to upper case
| Terminates a previous < or > sequence
\ Escape: treat the next character in the mask as literal text rather than a mask symbol