Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fill each record in a grid with different color
Message
 
À
21/02/2001 21:30:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00478268
Message ID:
00478273
Vues:
22
>Can we set each row in a grid with different color?
>
>We want to use at least 6 colors (black,red,green,yellow, purple, blue)
>
>I've tried using the grid.dynamicbackColor but only 2 colors can be used.
>
>Thanks a lot for your help,

You can use more than 2 colors with DynamicBackColor. To do it directly, you'd have to embed several IIF() statements, which isn't very maintainable. Instead, I'd recommend that you put a UDF call in the DynamicBackColor property. You can make that UDF a method on the form. Code it something like this: (I haven't run this code to test it.)
lparameter tnRecno

do case
case mod(tnRecno,6) = 0
   return "RGB(0,0,0)"
case mod(tnRecno,5) = 0
   return "RGB(255,0,0)"
case mod(tnRecno,4) = 0
   return "RGB(0,255,0)"
case mod(tnRecno,3) = 0
   return "RGB(0,0,255)"
case mod(tnRecno,2) = 0
   return "RGB(255,0,255)"
otherwise
   return "RGB(0,255,255)"
endcase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform