Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric Text box adding a zero
Message
From
30/01/2004 10:55:07
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/01/2004 07:46:19
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00872246
Message ID:
00872339
Views:
17
>I have a problem with a text box I am using to enter an amount adding a zero. For example, if I enter 25.35 the text box show 250.35. When I press the decimal place it adds the zero. I have the input mask setup as 9999999.99 and the format is K (select on entry) I have changed a bunch of other things but nothing seems to work. This is for VFP 5.

I've seen this a lot when inputmask was having separators (comma for thousands). The solution was to remove the separator in the .gotfocus and put it back in .lostfocus; for that, I've added a property .SaveMask to the textbox:
* gotfocus
With This
	If "9,9" $ this.inputmask
	   .SavePicture=.InputMask
	   .selectonentry=.t.
	   .InputMask=Chrt(.InputMask, ",", "")
	   .refresh
	endif
EndWith
* lostfocus
With This
	If !empty(.SavePicture)
	   .InputMask=.SavePicture
	   .savepicture=""
	   .refresh
	endif
EndWith
And yes, this was in VFP5. I haven't removed the code in later versions, because it just worked.
Now if you're saying the inputmask is "9999999.99" and not "9,999,999.99" (which was causing the problems in my case), I don't really know what's wrong. I hope this would give you at least a starting point.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform