Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trailing Zeros in Text Box
Message
From
02/05/2005 11:13:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/05/2005 02:22:27
Michael Gass
Instructional Software, Inc.
Kirkland, Washington, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01010087
Message ID:
01010147
Views:
32
>I have a numeric field in a table with 3 decimal places that’s the control source for a Txtnumeric text box from the Codemine cmGadget.vcx. I would like trailing zeroes in the table to not appear in the text box. I would also like the user to be able to enter up to three decimal places in the text box but when he leaves the text box any trailing zeros would disappear from the text box. I was hoping for something simple that I’m missing in the Txtnumeric text box or a simple function that would take care of the problem for me. Any suggestions would be appreciated. Thanks!

I usually get rid of the spaces when reading the value out:
lcUserOption = alltrim(ThisForm.TxtOption.Value)
Even when the TextBox is not tied to a field (through the ControlSource), trailing blanks sometimes appear.

When the TextBox is directly tied to a field, it will always have the size of the field. You can, however, control user input through properties such as .InputMask or .Format.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform