SitesMasstec said:
I am trying to have the textbox completely empty until I begin to type numbers.
Aha, at least we're getting somewhere.
That's a very specific demand, I don't see how you get that. If you want a simple textbox without using a class with much code and want to use the inputmask feature of VFP, then you don't get around specifying a numeric value, and indeed, even with Format "Z", once you focus the textbox the display value will switch to 0.00. You could call it a bug perhaps, but you know there is nobody at Microsoft changing VFP, not even a little bit.
So, stick to your demand, then you likekly will to program for the special cases like that instance when the textbox get's first focus, and your code will get longer than even that of Kilofox from Andy Kramek and Marcia Atkins, two Foxpro experts that were MVPs. Every single one has more knowledge than me. Or you have to lower your demands.
It's not a solution to not use the inputmask, that's for sure, because without an inputmask, the characters the user can enter are not limited, and then you don't just have the problem that the inputmask can't be converted to the desired result, the input then is not restricted to only digits, one decimal point or comma and perhaps an overall size or range.
You only set textbox.value to 0.00 and the inputmask to 999,999,999.99 and you get the following behavior for free, without any line of code:
a) the user can enter a sign + or -, the user can enter any number of digits, when the number of digits rises to 4 a first thousands separator is shown, when you reach a 7 digit number the second thosands separator is shown. Now at any moment the user enters a decimal point (or comma), the nmumber entered so far is becoming shown right before the decimal point (or comma), the text cursor will jump right after the deicmal point (or comma) and the user types the decimal places. It's almost impossible to have any more comfortable input, ubnless you program an AI that predicts what the user will type in next.
You don't even imagine what code would be necessary without the inputmask property to get this guidance and helpful display of the number entered in a human readable format with the thousands separator as helpful assurance the number entered has the right magnitude and you don't error by a factor of 10 or even 100.
Now you come along and say you don't like the inital 0.00 to be shown. You don't show any decency, if you reject the whole system just because you don't like this one detail.
And yes, you can program a textbox that allows what you initially posted in all your steps, but what you write there is also merely a sketch of what the behavior is, you're then not even having the decency to detail what you want to have as the exact description of what someone should program. Instead, anything you're offered is rejected by you. You lost me.
Chriss