18

Do you know any freely available WPF component for using masks (regex) in textbox?

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Victor Rodrigues
  • 11,353
  • 23
  • 75
  • 107
  • **Related posts** - [showing password characters on some event for passwordbox](https://stackoverflow.com/q/10091466/465053) **&** [A good way to show password in PasswordBox](https://stackoverflow.com/q/17007630/465053) – RBT Apr 10 '18 at 05:59

3 Answers3

20

I think you will find what you need in this control library: http://www.codeplex.com/WPFDeveloperTools

Look for 'FilteredTextBox' amongst all the other useful controls. I don't think it does regex, but it should be able to filter just about everything you need, and since you will have the source, you should find it easy to enhance.

As a bonus, it is free and open source on CodePlex.

You can also find a nice blog post about how to go about implementing this yourself here: http://marlongrech.wordpress.com/2007/10/28/masked-textbox/

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
4

Extended WPF Toolkit has a MaskedTextBox similar to the one that was in WinForms. As with the old one, this doesn't actually support RegExes, but has a subset of useful masks.

Oh, and it's on NuGet, which is nice.

dmtweigt
  • 83
  • 4
Pat
  • 16,515
  • 15
  • 95
  • 114
0

Coding Monk has a good TextboxEditMask Behavior. You can either download the source code or just use the dlls.

Matt Zappitello
  • 785
  • 2
  • 11
  • 30