ComponentOne True DBInput Pro 8.0
Format Property (TDBMask)

 

Format Property (TDBMask)

Sets/returns the input and the display mask to use in the control.

Syntax

TDBMask.Format= string

Read/Write at run time and design time.

Remarks

The format is specified by creating a mask using keywords and literals. Note that the input mask must not exist only with literals.

When keywords need to be used as literals, place a backslash before the keyword.  This will differentiate a keyword from a literal.  For example, to make a display mask like "__/__/19__" you would set the property to "&&/&&/1\9&&". The 9 must be preceded by a backslash ("\") because it is used as a keyword.

If the Format property is set to a zero-length string, the characters allowed for entering will not be restricted just like the standard TextBox, with the exception of the space character when the AllowSpace property is set to False.

The following properties will not have any effect when the Format property is set to a zero-length string: PromptChar, ShowLiterals

The Format property now supports three separate format patterns delimited with a semicolon (";"). The first pattern is used to define the input mask, the second for empty values when the control has the focus and the third for empty values when the control loses focus.

When losing the focus, the control will display a zero-length string.

When more than one character is defined within the braces, the control picks the first character in the expression for implementing.

Note that the keywords except the braces ("{}") will be treated as literal characters within the Empty format patterns. If the braces are needed, place a backslash before them to differentiate from a literal.

If both the Empty expressions are omitted, the control uses the default input mask which includes all the literals and the prompt character specified in the PromptChar property (default is "_") to express empty values (same as when clearing the control).

The Empty format patterns will be ignored when the input mask is not defined. For example, a format string such as ";{0};{0}" or ";Empty;Empty"  will be treated equivalent as " - a zero-length string. This is because when the input mask is not specified, the control cannot distinguish between the entered text and the text defined as the Empty format patterns. The character specified between the braces ("{}") in the input mask must be set to a zero-length string or a SBCS character. A DBCS character will be treated as an error.

If you set the AutoConvert property to True, all convertible characters will be automatically converted accordingly to the input mask. For example, if set the input mask to  "A", by hitting a lower case character the control automatically converts the character into an upper case. When a SBCS character is entered in a DBCS format, the entered character will be automatically converted to DBCS. The AutoConvert property tries converting as much as possible.

The maximum number of characters that can be held in the control will be determined by the input mask define. When you set the Format property to a zero-length string, although the number of characters allowed in the control will not be restricted, but will vary depending upon the available system resources.

See Also

AllowSpace Property (TDBMask)

AutoConvert Property (TDBMask)

LookupMode Property (TDBMask)

LookupTable Property (TDBMask)

PromptChar Property (TDBMask)

ShowLiterals Property (TDBMask)

Text Property (TDBMask)

Value Property (TDBMask)

InvalidInput Event (TDBMask)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback