'宣言 Public Property EditMask As System.String
public System.string EditMask {get; set;}
'宣言 Public Property EditMask As System.String
public System.string EditMask {get; set;}
The EditMask specifies an input mask for automatic input formatting and validation. The mask syntax is similar to the one used by the Microsoft MaskedEdit ActiveX control and by Microsoft Access and is described below.
Set the EditMask property in response to the BeforeEdit event, in the same way you would set the ComboList property.
If the same mask is used to edit all values in a column, use the column's RowCol.EditMask property. This simplifies your code because you don't need to handle the BeforeEdit event.
When the user is done editing a cell with a mask, the ValidateEdit event fires. The event parameter will be set to true if the mask was not filled out properly, so in most cases you don't have to implement the handler. The default behavior ensures that only valid data will be entered.
The EditMask string is composed of the following symbols:
1) Wildcards
0 digit
9 digit or space
# digit, space, or sign
L letter
? letter or space
A letter or digit
a letter, digit, or space
& any character
2) Localized characters
. localized decimal separator
, localized thousand separator
: localized time separator
/ localized date separator
3) Command characters
\ next character is taken as a literal
> translate letters to uppercase
< translate letters to lowercase
4) Placeholder specification
; next character is used as a placeholder (the default is an underscore)
flex.EditMask = "(###) 000-0000 St\ate\: >LL;*";