This project has moved. For the latest updates, please go here.

How to change the Mask based on the contents of the MaskedTextBox

Jun 14, 2012 at 3:19 PM

Hi,

My Mask represents a dutch telephone number. Based on the contents of the Textbox it has to support 3 different mask:

- (00) 00 00 00 00 if the contents starts with '06'

- (000) 000 00 00 if the contents starts with '010'

- 0000000000 otherwise

So when the users starts typing the mask has to change based on the contents. I have tried for hours but changing the mask results in events like TextChanged, etc. making it very hard to implement.

I am looking for the best place to insert the above functionality.

Thanks in advance!

Michel Miranda