Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Negative amounts in red with parens
Message
From
09/05/2007 06:00:38
 
 
To
08/05/2007 17:20:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01223619
Message ID:
01223697
Views:
19
>I need a control that displays negative dollar amounts in red and with parenthesis instead of a minus sign. I will use it for data entry as well as inside grid controls - the latter for display only, not data entry.
>
>I've been able to use an assign method on the Value property to change the forecolor if the value is negative. (It got a little tricky with using the control in a grid, but I've gotten it to work.) What I'm having trouble with is removing the negative sign and using parenthesis instead. I haven't found any format code or input mask that will do this. Any ideas?

If you have a textbox classed to accept the value, you could use ABS() to get rid of the minus sign, in one of its methods - say prog...change() or valid(). An IIF() could change the colour dep. on +/-.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform