Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid font color
Message
 
To
01/02/2004 06:48:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00872757
Message ID:
00872772
Views:
22
Chaim

>Who can help me?
I can help you :-)

>How can I change the forecolor of the fonts in the grid by the value.
>I entered the following code in the grid\cell\refresh but it's not working.
>HERE IS THE CODE:
>
tv=left(allt(this.value),3)
>do case
>case len(tv)<3
>	this.forecolor=rgb(255,255,255)
>case tv='AAA'
>	this.forecolor=rgb(255,255,128)
>case tv='BBB' or tv='CCC'
>	this.forecolor=rgb(255,0,0)
>endcase
You should use DynamicForeColor in grid for that. You can also set it all by putting something like the following in your Grid's Refresh code:
*** assuming the record value is named mytable.myval
This.SetAll("DynamicForeColor","iif(len(mytable.myval)<3,rgb(255,255,255),iif(mytable.myval='AAA',rgb(255,255,128),rgb(255,0,0)))"
Of course, you could do the same with DynamicBackColor for the backcolor, etc...

HTH
Jaime
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Reply
Map
View

Click here to load this message in the networking platform