1. Go to Tool>NuGet Package Manager> Package Manager Console.
(In Visual
Studio).
2. Run this Command (without double-quotes) "Install-Package Extended.Wpf.Toolkit"
. (Extended Wpf Toolkit will be installed and added to your project).
3. Add a using statement ("using Xceed.Wpf.Toolkit;") to the top of .cs file.
4. Add a new xmlns (for example
xmlns:wpfx="http://schemas.xceed.com/wpf/xaml/toolkit" to the top of XAML files .
and the XAML for Masked Text box is.
<wpfx:MaskedTextBox Mask="000-000-0000" x:Name=" Width="150" Height="24" >
Mask
Element
Description
Digit, required. This element will accept any single digit between 0 and 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.
Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask
element is equivalent to [a-z A-Z] in regular expressions.
Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask
element is equivalent to [a-z A-Z]? in regular expressions.
Character, required. If the Ascii Only property is set to true, this element
behaves like the "L" element.
Character, optional. Any non-control character. If the Ascii Only property is set to
true, this element behaves like the "?" element.
Alphanumeric, optional. If the Ascii Only property is set to true, the only
characters it will accept are the ASCII letters a-z and A-Z.
Alphanumeric, optional. If the Ascii Only 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
Format Provider property.
Thousands placeholder. The actual display character used will be the thousands
,
placeholder appropriate to the format provider, as determined by thecontrol's
Format Provider property.
Time separator. The actual display character used will be the time symbol
:
appropriate to the format provider, as determined by the control's Format
Provider property.
Date separator. The actual display character used will be the date symbol
/
appropriate to the format provider, as determined by the control's Format
Provider property.
Currency symbol. The actual character displayed will be the currency symbol
$
appropriate to the format provider, as determined by the control's Format
Provider 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.