Type | Description | |||
String | A string expression that indicates the control's mask |
Starting from the version 7.1 the Mask property has been radically changed as explained bellow. If using any previously version, you can find the specifications at the bottom of the page.
For instance, the following input-mask ( ext-phone )
"!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid character,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."
indicates the following:
The four parts of an input mask, or the Mask property supports up to four parts, separated by a semicolon (;). For instance, "`Time: `00:00:00;;0;overtype,warning=<fgcolor FF0000>invalid character,beep", indicates the pattern "00:00" with the prefix Time:, the masking character being the 0, instead _, the field enters in over-type mode, insert-type mode is not allowed, and the field beeps and displays a tooltip in red with the message invalid character when the user enters an invalid character.
Input masks are made up one mandatory part and three optional parts, and each part is separated by a semicolon (;). If a part should use the semicolon (;) it must uses the \; instead
The purpose of each part is as follows:
The following table lists the placeholder and literal characters for an input mask and explains how it controls data entry:
Characters enclosed in double quotation ("" or ``) marks will be displayed literally. If this part should display/use the semicolon (;) character is should be included between double quotation ("" or ``) characters or as \; ( escape ).
The known options for the forth part are:
float, indicates that the field is edited as a decimal number, integer. The first part of the input mask specifies the pattern to be used for grouping and decimal separators, and - if negative numbers are supported. If the first part is empty, the float is formatted as indicated by current regional settings. For instance, "##;;;float" specifies a 2 digit number in float format. The grouping, decimal, negative and digits options are valid if the float option is present. Use the MaskFloat property to mask floating point numbers including digit grouping.
Experimental:
multiline, specifies that the field supports multiple lines.
rich, specifies that the field displays a rich type editor. By default, the standard edit field is shown
disabled, shows as disabled the field.
Prior to version 7.1 the Mask property supports the following special characters.
Here's the list of all rules and masking characters.
The following sample shows how to mask an IP address:
MaskEdit1.Mask = "{0,255}\.{0,255}\.{0,255}\.{0,255}"