Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input mask like a calculator for a numeric textfield
Message
 
 
To
29/07/1999 11:55:29
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00247677
Message ID:
00247735
Views:
27
I am sure that with a little more work and thought, this control could be designed to do just about anything as far as testing for before and after data types, adding a property to tell the control how to leave the value (character or numeric), a property to define what the control source is so we can use a particular field without binding, etc.

>Hmmm, maybe we should combine the two (Jim's box and this idea to allow numeric expressions.) That would give a "true" calculator type box that we could upload here.
>
>I was missing converting the expression back to a string. Thanks for pointing it out! :-)
>
>>>>Go to Files, Classes/VCX. Jim Booth has a textbox number class which what you are looking for. There is also a second one called Textnum2 or something like that which is a modification of Jim's. Look for #'s 803 and 806.
>>>
>>That is a cool idea. I placed the following in the LostFocus of a textbox with no mask, and it works:
>>if type('eval(This.value)') = "N"
>>   This.Value = alltrim(str(eval(This.Value)))
>>endif
>>The trick may be to always treat the before and after value as character. I also would manually bind this to a field. Perhaps in the textbox Refresh, put: this.value = somefield [convert to character if needed]. Add to the lost focus, replace somefield with this.value [convert back to numeric if needed].
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform