Using MaskedTextBox for currency values

  • Thread starter Thread starter A.M-SG
  • Start date Start date
A

A.M-SG

Hi,

What would be the best mask for MaskedTextBox for Currency fields?

Thank you,
Alan
 
Hi Alan,

To use mask for Currency fields in MakedTextBox, you can use the $ symbol.
The actual character displayed will be the currency symbol appropriate to
the format provider, as determined by the control's FormatProvider
property. For more information, you can check the following link:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.
mask.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Hi Kevin,



$ just shows the symbol beside the text.



The problem is much deeper than that.



Try to use "$########.##" as the mask, then run the form and enter $2.54.
Even it is possible to enter that amount, it is no acceptable in serious
production quality applications. Because I cannot expect my user to use
arrow keys or space to adjust the cursor in right position.



What I asked was the proper mask for currency mask for practical real world
applications.



Regards,

Alan
 
Hi Alan,

Sorry, but this is the designed behavior of maskedTextBox. Let's wait here
to see if any community member can provide some 3rd party control that can
meet your requirements here.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top