How to Format MaskedTextBox Control

Posted on 2007-11-13
Last Modified: 2013-11-26
Good Day:

I am using VS.NET 2005 Windows.Forms.MaskedTextBox Control.  I would like to format my MaskedTextBox control to display data as 99,000 or 9,000.  Unfortunately when I have a value of 9992 it gets displayed as 99,9200 using the format ##,###  It works when I use the format #,### but i need to have the format flexible for values of 99,000 or 9,000.

Any Suggestions?
Question by:DeniseGoodheart
  • 2
  • 2
LVL 48

Expert Comment

ID: 20275636
Hello Denise,

Have you tried "#0,000" ?

Author Comment

ID: 20275936
Hi jpaulino:

Yes I've tried all sorts of combinations; including the one you suggested with no success.

LVL 48

Accepted Solution

jpaulino earned 500 total points
ID: 20276033
Why don't you use an regular textbox and set the format on leave event ?

Author Comment

ID: 20290696
Hi Jpaulino:

I finally gave up trying to use the mask control, and added labels and used the format function.

Thank You,

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now