Updated MaskedTextBox (markdown)

master
DianeXceed 9 years ago
parent
commit
14fa98413d
  1. 119
      MaskedTextBox.md

119
MaskedTextBox.md

@ -3,11 +3,11 @@ Derives from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox
Represents a control that limits the input text to the format determined by the specified mask. Represents a control that limits the input text to the format determined by the specified mask.
![](MaskedTextBox_maskedtextbox_editing.jpg) [[MaskedTextBox_maskedtextbox_editing.jpg]]
Note: This version of MaskedTextBox replaces the toolkit's original control, providing a much more complete API. The original control is still available in the Xceed.Wpf.Toolkit.Obselete namespace; see [MaskedTextBox (obsolete version)](MaskedTextBox-(obsolete-version)). Note: This version of MaskedTextBox replaces the toolkit's original control, providing a much more complete API. The original control is still available in the Xceed.Wpf.Toolkit.Obsolete namespace; see [[MaskedTextBox (obsolete version)]].
{{ ```
<sample:DemoView x:Class="Samples.Modules.Text.Views.MaskedTextBoxView" <sample:DemoView x:Class="Samples.Modules.Text.Views.MaskedTextBoxView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -80,60 +80,63 @@ Mode=TwoWay}"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</sample:DemoView> </sample:DemoView>
}} ```
## Supported Masks ### Supported Masks
|| Masking Element || Description | Masking Element | Description |
| 0 | Digit, required. This element will accept any single digit between 0 and 9. | --- | --- |
| 9 | Digit or space, optional. | 0 | Digit, required. This element will accept any single digit between 0 and 9. |
| # | 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. | 9 | Digit or space, optional. |
| L | Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z](a-zA-Z) in regular expressions. | # | 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. |
| ? | Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z](a-zA-Z)? in regular expressions. | L | Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z](a-zA-Z) in regular expressions. |
| & | Character, required. If the AsciiOnly property is set to true, this element behaves like the "L" element. | ? | Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z](a-zA-Z)? in regular expressions. |
| C | Character, optional. Any non-control character. If the AsciiOnly property is set to true, this element behaves like the "?" element. | & | Character, required. If the AsciiOnly property is set to true, this element behaves like the "L" 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. | 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. | 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. |
| , | 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. | . | 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. |
| : | 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. | , | 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. |
| / | 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. | : | 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. |
| $ | Currency symbol. The actual character displayed will be the currency 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. |
| < | Shift down. Converts all characters that follow to lowercase. | $ | 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 up. Converts all characters that follow to uppercase. | < | Shift down. Converts all characters that follow to lowercase. |
| | Disable a previous shift up or shift down. | > | Shift up. Converts all characters that follow to uppercase. |
| \ | Escape. Escapes a mask character, turning it into a literal. "\\" is the escape sequence for a backslash. | | 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. |
## Properties
|| Property || Description ### Properties
| AutoMoveFocus | Gets or sets a value indicating if the focus can navigate in the appropriate flow direction (e.g., from one cell to another when a cell is being edited) when the cursor is at the beginning or end of the auto-select text box. (Inherited from Xceed.Wpf.Toolkit.AutoSelectTextBox) | Property | Description |
| AutoSelectBehavior | Gets or sets a value indicating how the content of the auto-select text box is selected (Never or OnFocus). By default Never. | --- | --- |
| BeepOnError | Gets or sets whether a beep sound will be played on error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | AutoMoveFocus | Gets or sets a value indicating if the focus can navigate in the appropriate flow direction (e.g., from one cell to another when a cell is being edited) when the cursor is at the beginning or end of the auto-select text box. (Inherited from Xceed.Wpf.Toolkit.AutoSelectTextBox) |
| FormatProvider | Gets or sets the format provider. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | AutoSelectBehavior | Gets or sets a value indicating how the content of the auto-select text box is selected (Never or OnFocus). By default Never. |
| HasParsingError | Gets whether the control has a parsing error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | BeepOnError | Gets or sets whether a beep sound will be played on error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| HasValidationError | Gets whether the control has a validation error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | FormatProvider | Gets or sets the format provider. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| InsertKeyMode | Gets or sets a value representing the text insertion mode of the masked text box. | HasParsingError | Gets whether the control has a parsing error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| IsMaskCompleted | Gets a value indicating if all required characters have been inputted into the mask. | HasValidationError | Gets whether the control has a validation error. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| IsMaskFull | Gets a value indicating if all characters, required and optional, have been inputted into the mask. | InsertKeyMode | Gets or sets a value representing the text insertion mode of the masked text box. |
| IsValueOutOfRange | Gets whether the control's value is out of range. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | IsMaskCompleted | Gets a value indicating if all required characters have been inputted into the mask. |
| Mask | Gets or sets the input mask. | IsMaskFull | Gets a value indicating if all characters, required and optional, have been inputted into the mask. |
| MaskTextProvider | Gets the MaskedTextProvider that was used to mask the input text. | IsValueOutOfRange | Gets whether the control's value is out of range. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| MaxValue | Gets or sets the maximum value of the control. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | Mask | Gets or sets the input mask. |
| MinValue | Gets or sets the minimum value of the control. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | MaskTextProvider | Gets the MaskedTextProvider that was used to mask the input text. |
| NullValue | Gets or sets the null value. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | MaxValue | Gets or sets the maximum value of the control. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| PromptChar | Gets or sets the character that represents the positions in the masked text box that require user input. | MinValue | Gets or sets the minimum value of the control. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| RejectInputOnFirstFailure | Gets or sets a value indicating if inputted text that is pasted into the masked text box can be rejected if it contains an invalid character for the corresponding mask position. | NullValue | Gets or sets the null value. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| ResetOnPrompt | Gets or sets a value indicating if the character at the current caret position should be reset when the prompt character is pressed. | PromptChar | Gets or sets the character that represents the positions in the masked text box that require user input. |
| ResetOnSpace | Gets or sets a value indicating if the character at the current caret position should be reset when the space bar is pressed. | RejectInputOnFirstFailure | Gets or sets a value indicating if inputted text that is pasted into the masked text box can be rejected if it contains an invalid character for the corresponding mask position. |
| RestrictToAscii | Gets or sets a value indicating if the masked text box accepts non-ASCII characters. | ResetOnPrompt | Gets or sets a value indicating if the character at the current caret position should be reset when the prompt character is pressed. |
| SkipLiterals | Gets or sets a value indicating if literal values can be overwritten by their same values. | ResetOnSpace | Gets or sets a value indicating if the character at the current caret position should be reset when the space bar is pressed. |
| Text | Content of the MaskedTextBox. (Inherited from System.Windows.Controls.TextBox) | RestrictToAscii | Gets or sets a value indicating if the masked text box accepts non-ASCII characters. |
| Value | Gets or sets the value of the MaskedTextBox. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | SkipLiterals | Gets or sets a value indicating if literal values can be overwritten by their same values. |
| ValueDataType | Gets or sets the Type of the value. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | Text | Content of the MaskedTextBox. (Inherited from System.Windows.Controls.TextBox) |
| Value | Gets or sets the value of the MaskedTextBox. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
## Events | ValueDataType | Gets or sets the Type of the value. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
|| Event || Description
| QueryTextFromValue | Raised when an attempt is made to convert the specified value into its string representation. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) ### Events
| QueryValueFromText | Raised when an attempt is made to extract a value from the specified text. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) | Event | Description |
| --- | --- |
| QueryTextFromValue | Raised when an attempt is made to convert the specified value into its string representation. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
| QueryValueFromText | Raised when an attempt is made to extract a value from the specified text. (Inherited from Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox) |
**Support this project, check out the [Plus Edition](https://xceed.com/xceed-toolkit-plus-for-wpf/).**
--- ---
**Support this project, check out the [Plus Edition](https://xceed.com/xceed-toolkit-plus-for-wpf/).**
Loading…
Cancel
Save