'DeclarationPublic Property Mask As String
'UsageDim instance As MaskedTextBox Dim value As String instance.Mask = value value = instance.Mask
public string Mask {get; set;}
'DeclarationPublic Property Mask As String
'UsageDim instance As MaskedTextBox Dim value As String instance.Mask = value value = instance.Mask
public string Mask {get; set;}
The IncludeLiteralsInValue property determines whether literals in the Mask are included in the Value.
The IncludePromptInValue property determines whether prompt characters in the Mask are included in the Value.
The following table lists the supported mask strings.
| Masking Element | Description |
| 0 | Digit, required. This element will accept any single digit between 0 and 9. |
| 9 | Digit or space, optional. |
| # | Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the Text property. Plus (+) and minus (-) signs are allowed. |
| L | Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions. |
| ? | Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions. |
| & | Character, required. If the AsciiOnly property is set to true, this element behaves like the "L" element. |
| C | Character, optional. Any non-control character. If the AsciiOnly property is set to true, this element behaves like the "?" element. |
| A | Alphanumeric, optional. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. |
| a | Alphanumeric, optional. If the AsciiOnly property is set to true, the only characters it will accept are the ASCII letters a-z and A-Z. |
| . | Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's FormatProvider property. |
| , | Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's FormatProvider property. |
| : | Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's FormatProvider property. |
| / | Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's FormatProvider property. |
| $ | Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's FormatProvider property. |
| < | Shift down. Converts all characters that follow to lowercase |
| > | Shift up. Converts all characters that follow to uppercase. |
| Disable a previous shift up or shift down. | |
| \ | Escape. Escapes a mask character, turning it into a literal. "\\" is the escape sequence for a backslash. |
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.