Trusted by the world’s leading companies
Overview
The WPF MaskedTextBox control is an enhanced version of the text box that additionally restricts input to conform to a specific structure or mask.
Variable length mask expression
The WPF MaskedTextBox control gives you great flexibility to control variable length of data input.

Culture
Special symbols like currency symbols, date separators, decimal separators etc., are applied based on the provided culture

Custom prompt character
The WPF MaskedTextBox control provides the flexibility to customize the prompt character when the default prompt character ( _ ) is not suitable for your scenario.

Validation Mode
The WPF MaskedTextBox control lets you to choose when to validate the data input.

Lost focus
Validate the data input when the control loses its focus.

Key press
Validation triggers for each key press.
Formatting Value
While fetching the value, masked text box control provides the option to format the text with literals and prompt characters.

Exclude prompt and literals
Value contains only the typed characters; the prompt characters and literals are excluded.

Include prompt
Value contains the typed characters and available prompt characters, literals are excluded.

Include literals
Value contains the typed characters and literals; prompt characters are excluded.

Include prompt and literals
Value contains typed characters, prompt characters, and literals.
Watermark
The watermark will prompt you with instructions or important information, when it is not in focus and no characters are not entered.

Appearance
Appearance is highly customizable.

Text appearance
The WPF MaskedTextBox control allows you to change the font name, font style, font size and its color.

Border color
Customize border color of the masked edit control to any of the preferred color.

Error border color
The WPF MaskedTextBox control provides the flexibility to customize the error border color when the default error border color (Color.Red) is not suitable for your scenario.
WPF MaskedTextBox Code Example
Easily get started with the WPF MaskedTextBox using a few simple lines of XAML and C# code example as demonstrated below. Also explore our WPF MaskedTextBox Example that shows you how to render and configure the MaskedTextBox in WPF.
<syncfusion:SfMaskedEdit x:Name="sfMaskedEdit" Width="100" Height="25" />using Syncfusion.Windows.Controls.Input;
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
//Creating an instance of SfMaskedEdit control
SfMaskedEdit sfMaskedEdit = new SfMaskedEdit();
sfMaskedEdit.Width = 100;
sfMaskedEdit.Height = 25;
//Adding SfMaskedEdit as window content
this.Content = sfMaskedEdit;
}
}
}Not sure how to create your first WPF MaskedTextBox? Our documentation can help.
I’d love to read it now145+ WPF CONTROLS
Frequently Asked Questions
Why should you choose Syncfusion WPF MaskedTextBox?
- Masking the input value is made easy.
Three types of mask options based on input.
- Watermark text support when value is null.
- Simple configuration and API.
- Touch-friendly and responsive UI.
Extensive demos, documentation to learn quickly and get started with WPF MaskedTextBox.
Can I download and utilize the Syncfusion WPF MaskedTextBox for free?
No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.
How do I get started with Syncfusion WPF MaskedTextBox?
A good place to start would be our comprehensive getting started documentation.
Our Customers Love Us
Awards
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.