Retrieves or sets a string expression that indicates the control's mask.
Type
Description
String
A string expression that indicates the control's mask
Indicates the control's mask. Use the MaskValue
property to get the value entered, and use the Valid
property to check the value's validity. Use the Masks
property to provide multiple masks to the control. Use the MaskFloat
property to mask floating point numbers without displaying the masking
character. The MaskChange
event is fired when the Mask property is changed. The Mask property is composed by a
combination of regular characters, literal escape characters, and masking
characters. The Mask property can contain also alternative characters, or range
rules. A literal escape character is preceded by a \ character, and it is used
to display a character that is used in masking rules.
Here's the list of all
rules and masking characters.
# (Digit), Masks a digit character, [0-9]
x (Hexa Lower), Masks a lower case hexa character, [0-9],[a-f]
X (Hexa Upper), Masks an
upper case hexa character, [0-9],[A-F]
A (AlphaNumeric), Masks a
letter or a digit. [0-9], [a-z], [A-Z]
? (Alphabetic), Masks
a letter. [a-z],[A-Z]
< (Alphabetic lower), Masks
a lower case letter. [a-z]
> (Alphabetic upper), Masks
an upper case letter. [A-Z]
* (Any), Masks any
combination of characters.
\ (Literal Escape), Displays
any masking characters. The following combinations are valid:
\#,\x,\X,\A,\?,\<,\>,\\,\{,\[
{nMin,nMax} (Range),
Masks a number in a range. The nMin and nMax values should be numbers. For
instance the mask {0,255} will mask any number between 0 and 255.
[...] (Alternative),
Masks any characters that are contained in the [] brackets. For instance,
the [abcA-C] mask any character: a,b,c,A,B,C
The following sample shows how to mask an IP address: