We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MaskEdit Syntax

Hi, What is the syntax I could use in the mask property of a MaskEdit control ? I know that : # = any character (optional) 9 = any number (optional) What is the syntax for an mandatory number and mandatory character ? Is it also possible to use something like HH:mm or dd/mm/yyyy ? Thanks, Didier

3 Replies

AD Administrator Syncfusion Team January 16, 2004 11:40 AM UTC

Hi Didier, You could directly place the mandatory number/character itself in the Mask, and it will be displayed as it is. The MaskedEditBox does not perform automatic validation and hence we do not have specialised Mask values like HH:mm or MM/dd/yyyy. You could use Mask values like ##:## and ##/##/####, and then perform validation explicitly. I have attached a list of Mask characters that can be used below : # - 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. Please refer to our class reference for more information on this. Our class reference is integrated with the VS.NET''s documentation. You could access it by StartMenu >> Programs >> MS VS.NET >> MS VS.NET Documentation. Enter "MaskedEditBox" in the ''Look for:'' field and select ''(no filter)'' option in the ''Filtered by:'' field. In future, please address your questions through Direct Trac as far as possible, since it is the fastest and best way of receiving technical support. Thanks for your cooperation. Regards, Guru Patwal Syncfusion, Inc.


DS David Shin January 19, 2006 11:59 PM UTC

How do we make a mask accept international/unicode characters?


AD Administrator Syncfusion Team January 25, 2006 11:55 PM UTC

Hi David, We regret for the delay in responding. The mask character C can be used to accept any unicode character. Special masks such as uppercasing and lowercasing will only work with the ASCII characters: I have attached sample that illustrates using the MaskedEditBox with unicode. The sample sets the font of the MaskedEditBox to be Arial Unicode MS Thanks, Davis

MaskedEditUnicode.zip

Loader.
Live Chat Icon For mobile
Up arrow icon