none
MaskedTextBox and Money fields

    Question

  •  

    I am using a MaskedTextBox to enter a money value ie

    ft1.Mask = "#####.##";

     

     

    Is there anyway of keeping all the chars to the left of the decimal point until a decimal point is actually pressed?

    The cursor "jumps" the decimal point when it reaches it, regardless of what you are typing, and it doesn't feel very intuititive ot me.

    Friday, December 14, 2007 4:14 PM

Answers

All replies

  • OK. Let me try a different tack:

     

    http://download.microsoft.com/download/0/8/7/087e6a47-7306-4a5c-ad97-d1ffd58d712e/decimaltextbox.msi

     

    I find the DecimalTextBox does exactly what I need;

    Is there any restriction on using this in my applications?

    Friday, December 14, 2007 5:20 PM
  • Hi Ziggy,

     

    Since the DecimalTextBox is available on Microsoft download web site, there should be no restriction on using it in your applications.

    Monday, December 17, 2007 10:12 AM
  • Doesn't work if the cursor is to the right of the decimal.
    Example:
    Start up
    Enter 23.45 in the DecimalTextBox
    Cursor to before left most number (2).
    Hit the delete key until all numbers = 0 and cursor is positioned to right of decimal
    Type 23.45 again
    Only the .45 will show.

    It appears not to recognize the decimal.

    Also, try selecting the entire number as if you wanted to copy it.  The control won't let you select the entire number.

    VS 2008 sp1

    Thursday, November 12, 2009 5:33 PM