Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I dynamically change one cell in a grid?
Message
 
 
À
09/08/2001 16:30:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00542012
Message ID:
00542019
Vues:
14
>Hi all. Im building a small app for a visually impaired person and would olike to know how to change the backcolor of a cell in a grid depending upon its value. There would be 4 possible different values but it can work like "red if value=x, green if value<>x".
>TIA
>Ulises.

If there are only two cases, you should use column1.DynamicBackColor="iif(myTable.MyField=x,rgb(255,255,255),rgb(128,128,128)).

If there are bunch of cases, create a method of your form, called MyColor
column1.DynamicBackColor="thisform.myColor(MyTable.MyField)"

and put this code into MyColor method:
lparameter tValue
local lnColor
do case
   case tValue=x
       lnColor=rgb(....) && Red
   case tValue=y 
       lnColor=rgb(...) && Blue
    etc...
endcase
return m.lnColor
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform