Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to Format MaskedTextBox Control

Posted on 2007-11-13
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 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