Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coloring grids
Message
De
08/02/2006 20:36:03
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
08/02/2006 16:19:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01094787
Message ID:
01094847
Vues:
16
>Hi all,
>
>Can you display more then 2 colors dynamically within a Grid. I'd like to color individual cells to one of 4 different colors depending on data in record. Setall allows only for 2.

Set the dynamic*color to "myalias.nColor", and stuff the good rgb() values in the nColor field. I assume you're showing a cursor here, so adding an integer field or two (if you want more than one set of colors, one for each column - then add nColor2, nColor3 etc.) wouldn't be a problem.

When I say RGB() values I mean integers, not string expressions to be evaluated. For example, if you wanted yellow, it would require a 65535 (since VFP's color values are actually BGR - rgb(255,255,0) equals 0x00ffff, i.e. 65535). So just fill all the values before showing (or before refreshing) the grid and watch it.

This is the fastest way of coloring grids I've found so far - it only needs to read a color value from another field, no iif()s, no nested iif()s, no functions, no method calls, nothing. I've been using this since VFP6SP4, and the grid refreshes are still fast, even on a 200MHz machine with debugger on. With a method call for a dynamic*color, it took about 5 minutes on such a machine to refresh a 12x8 grid with debugger on.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform