Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the backcolor in a Grid
Message
De
09/01/2002 07:52:28
 
 
À
08/01/2002 21:34:42
Wilfred Chan
Bnp Paribas Hong Kong Branch
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00602300
Message ID:
00602433
Vues:
26
Hello WiFred.

It can be done by using "DynamicBackColor".
e.g.
WITH THIS.grid1
FOR i=2 TO 8
oCol=EVAL(".Column"+LTRIM(STR(i)))
oCol.DynamicBackColor="IIF(ATC('BLOCK',T1.F1)>0,RGB(255,0,0),RGB(0,0,255))"
NEXT
ENDWITH


This code, of course, assumes that the columns have not been renamed from the original names of Column1, Column2, etc. and that they have not been reordered after adding them to the grid. A more generic solution would be someting (untested) like this:
FOR EACH loColumn IN This.Columns
  IF loColumn.ColumnOrder > 1
    loColumn.DynamicBackColor = "IIF( 'BLOCK' $ EVAL( loColumn.ControlSource ), RGB( 255, 0, 0 ), RGB( 0, 0, 255 ) )"
  ENDIF
ENDFOR
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform