COXMaskedEdit Mask Characters

Dundas

COXMaskedEdit Mask Characters

Class Members | Overview

These are the characters you can use to set the mask:

  . (period)

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.

 

  , (comma)

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.

 

  : (colon)

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.

 

  / (slash)

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.

 

  #

Digit placeholder (0-9).

 

  A

Alphanumeric character placeholder (0-9 and a-Z).

 

  ?

Alphabetic placeholder (a-Z).

 

  >

Alphabetic placeholder, but forces uppercase chars (A-Z).

 

  <

Alphabetic placeholder, but forces them to lowercase (a-z).

 

  &

Character placeholder. Valid values for this placeholder are ANSI characters in the following ranges: 32-126 and 128-255.

 

  \

Literal escape. Use this to place your own literals in the mask - note that two backslashes must be used in string literals to accomodate for the fact that this is also treated as an escape character for ASNI/ISO string formatting.

As an example, lets look at a string to mask an IP address:

"IP \\Address: ###\\.###\\.###\\.###"

This will appear as:

IP Address: ___.___.___.___

Assuming that the placeholder or 'prompt' symbol has been set to the underscore.

Note that we needed to use the escape character to enable both the 'A' in Address and the periods to show as literals.

To display the string 'http:// ' we would have to use the escape char for the colon and slashes:

"http\\:\\/\\/ "

To display a backslash as a literal, we need to escape the escape, as in "c:\\\\AAAAAAAA\\.AAA"

 

See also: COXMaskedEdit::SetMask | COXMaskedEdit::GetMask | COXMaskedEdit::COXMaskedEdit | COXMaskedEdit::SetPromptSymbol