Masked Editors
The MaskedTextBox, which derives from the ValueRangeTextBox, forces inputted text to match the mask defined by its Mask and MaskedTextProvider properties (see Table 1 for a list of the supported mask characters). In addition to the limitations imposed by the mask, the inputted characters can be limited on only ASCII characters according to the value of the RestrictToAscii property.
Table 1: Supported mask characters
| Mask character | Description | Importance |
|---|---|---|
0 | Digit. Any single digit between 0 and 9 inclusively. | Required |
9 | Digit or space. Optional | |
# | Digit or space. If this position is blank in the mask, it will be rendered as a space. Plus (+) and minus (-) signs are allowed. | Required |
L | Letter. Restricts input to the ASCII letters a-z and A-Z. | Required |
? | Letter. Restricts input to the ASCII letters a-z and A-Z. | Optional |
& | Character. If the RestrictToAscii property is set to true, this character will behave like the "L" character. Required | |
C | Character. Any non-control character. If the RestrictToAscii property is set to true, this character will behave like the "?" character. | Optional |
A | Alphanumeric. If the RestrictToAscii property is set to true, input will be restricted to the ASCII letters a-z and A-Z. | Optional |
a | Alphanumeric. If the RestrictToAscii property is set to true, input will be restricted to the ASCII letters a-z and A-Z. | Optional |
. | Decimal placeholder. The actual character will be the decimal symbol appropriate to the format provider. | N/A |
, | Thousands placeholder. The actual character will be the thousands symbol appropriate to the format provider. | N/A |
: | Time separator. The actual character will be the time separator appropriate to the format provider. | N/A |
/ | Date separator. The actual character will be the date separator appropriate to the format provider. | N/A |
$ | Currency symbol. The actual character will be the currency symbol appropriate to the format provider. | N/A |
< | Shift down. Converts all following characters to lower case. | N/A |
> | Shift up. Converts all following characters to upper case. | N/A |
| ' | ' | Disable a previous shift up or down. N/A |
\ | Escape. Converts a mask character into a literal. | N/A |
| All others | Literals | N/A |