MaskedTextBox Currency Input Mask Limits

18,653

Solution 1

The standard way of applying the mask via Regular Expresions is detailed in Microsoft documentation: https://msdn.microsoft.com/en-us/library/ms234064.aspx Pertinent to your case it could be something like: $\d{9}.00 Hope this may help.

Solution 2

This worked for me. Instead of creating a custom mask, create a custom maskedTextbox.

Even with the correct mask, the delivered maskedTextBox is difficult for users to enter data. The currencyTextbox automatically formats/shifts the entered values.

https://blogs.msdn.microsoft.com/irenak/2006/03/21/sysk-87-a-better-maskedtextbox-for-currency-fields/

Once you add that class to your project, you'll see the currencyTextBox appear in your toolbox. Then just set a mask for it depending on how large a dollar value you want to store. According to the author, you use all 0s, I personally used "$000,000.00"

Share:
18,653
Lugarini
Author by

Lugarini

Updated on June 04, 2022

Comments

  • Lugarini
    Lugarini almost 2 years

    Im trying to make a Custom Input Mask for currency in Visual Studio 2013

    enter image description here

    But, this type of mask has a limit: 9999,00. I can't write numbers like 99999999,00.
    I want a mask that works with any amount of numbers
    Is it possible?