Edit Masks

I know this must be a simple answer, but I am struggling :slight_smile:

I want to add a mask to a TextEdit control that allows a number to be entered with decimal places. For example, 1.23 or 132.23 or 2460.22 or 57

Whatever masks I try I seem to get restricted into entering a certain number of digits.

Is there a mask that allows this flexibility (basically I need to control the users when entering currency values)

Thanks

Phil

“#,###.##” ?

Hmm, so if I enter 65 with this mask I get 6,5 - and it is not possible to enter just 65

The valid values entered could be 0.01 to 9,999,999.99

Am I missing something?

Seems mask is awfully stupid. I would rather use Format instead. At least it does not beep stupidly when I try to enter dot too early for it.

Hi,

Maybe “9999999.99” ?

Yep it is stupid :slight_smile:

Gone with trapping the Keydown and using Format together; seems to work well but means a number of events defining that I would rather avoid.

Maybe there is a need for a “Currency” property on the Edit control to use when the Mask isn’t flexible enough

Yeah - that works :slight_smile:

Not sure why I didn’t try 999999.99 but that and a Format to add thousand separators and currency symbol does it!

Thanks Guillermo