Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Edit Mask

What is the easiest way to specify an edit mask in WPF for a simple Text Box?

e.g. one that transforms 10000 to 10,000 as you type.

like image 497
Gus Paul Avatar asked Feb 10 '09 21:02

Gus Paul


1 Answers

Short answer, there is no easy way. If you use masks quite often, I would recommend creating your own control with masking functionality. Using the MaskedTextProvider class should be fairly straightforward.

See the following for an example of a custom TextBox with masking capabilities:

Masked TextBox example...

like image 179
Whytespot Avatar answered Sep 21 '22 14:09

Whytespot