Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Different color row highlights for diff. criteria on a g
Message
De
07/08/2006 02:00:56
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
À
05/08/2006 08:02:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01143188
Message ID:
01143363
Vues:
10
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!

********************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform