Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different color row highlights for diff. criteria on a g
Message
From
07/08/2006 02:00:56
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
To
05/08/2006 08:02:20
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01143188
Message ID:
01143363
Views:
12
You could do several levels, in fact, I learned from Cetin


New method called :: GetAge
LPARAMETER ldDOB, llsex
age = (date() - ldDOB)/365.25

DO CASE
CASE age >= 0 and age < 12
 nColor = iif(llsex=0,RGB(0,0,0),RGB(0,0,100))
CASE age >= 12 and age < 18
 nColor = iif(llsex=0,RGB(100,0,0),RGB(100,0,100))
CASE age >= 18 and age < 30
 nColor = iif(llsex=0,RGB(200,0,0),RGB(200,0,100))
CASE age >= 30 and age < 60
 nColor = iif(llsex=0,RGB(0,100,0),RGB(0,100,100))
CASE age >= 60 
 nColor = iif(llsex=0,RGB(0,200,0),RGB(0,200,100))
ENDCASE

Return nColor
In Grid's Init
ogrd.SetAll("DynamicBackColor", "thisform.getAge(client.age,client.sex)", "Column")
Of course, you can set the display options as you like, e.g. you can display ICONs, instead of changing the fontcolor
Best regards,

Aaron Chu

********************************************************

Working with Visual FoxPro is a lot of FUN!

********************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform