CompuGuide™
Velkommen
Mere info...
Programmering: Mask Property

Mask Property

Determines the input mask for the control.

Syntax

[form.]MaskedEdit.Mask [ = string$]

Remarks

You can define input masks at both design time and run time. However, the following are examples of standard input masks that you may want to use at design time. The control can distinguish between numeric and alphabetic characters for validation, but cannot check for valid content, such as the correct month or time of day.

Mask Description
Null String (Default) No mask. Acts like a standard text box.
##-???-## Medium date (US). Example: 20-May-92
##-##-## Short date (US). Example: 05-20-92
##:## ?? Medium time. Example: 05:36 AM
##:## Short time. Example: 17:23

The input mask can consist of the following characters.

Mask character Description
# Digit placeholder.
. Decimal placeholder. The actual character used is the one specified as the decimal placeholder in your international settings. This character is treated as a literal for masking purposes.
, Thousands separator. The actual character used is the one specified as the thousands separator in your international settings. This character is treated as a literal for masking purposes.
: Time separator. The actual character used is the one specified as the time separator in your international settings. This character is treated as a literal for masking purposes.
/ Date separator. The actual character used is the one specified as the date separator in your international settings. This character is treated as a literal for masking purposes.
\ Treat the next character in the mask string as a literal. This allows you to include the '#', '&', 'A', and '?' characters in the mask. This character is treated as a literal for masking purposes.
& Character placeholder. Valid values for this placeholder are ANSI characters in the following ranges: 32-126 and 128-255.
> Convert all the characters that follow to uppercase.
< Convert all the characters that follow to lowercase.
A Alphanumeric character placeholder (entry required). For example: a – z, A – Z, or 0 – 9.
a Alphanumeric character placeholder (entry optional).
9 Digit placeholder (entry optional). For example: 0 – 9.
C Character or space placeholder (entry optional). This operates exactly like the & placeholder, and ensures compatibility with Microsoft Access.
? Letter placeholder. For example: a – z or A – Z.
Literal All other symbols are displayed as literals; that is, as themselves.

When the value of the Mask property is an empty string (""), the control behaves like a standard text box control. When an input mask is defined, underscores appear beneath every placeholder in the mask. You can only replace a placeholder with a character that is of the same type as the one specified in the input mask. If you enter an invalid character, the masked edit control rejects the character and generates a ValidationError event.

Note   When you define an input mask for the Masked Edit control and you tab to another control, the ValidationError event is generated if there are any invalid characters in the Masked Edit control.

Data Type

String


Hjælp os med at blive bedre
Bedøm denne artikel:    Dårlig God
1 2 3 4 5 6 7 8 9 10

Løste artiklen dit problem?    Ja  Nej  Ved ikke

Navn:

E-mail:

Din kommentar: