Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forecolor flexibility in grid
Message
De
27/01/1999 13:15:19
 
 
À
27/01/1999 07:22:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00176326
Message ID:
00180907
Vues:
17
>>>Hi Peter.
>>>
>>>It's possible to change the colour of fonts or whatever
>>>in columns of Grid.
>>>
>>>See Dynamicforecolor and DynamicBackColor.
>>>
>>>For example
>>>
>>>Grid.Column(n).Dynamicforecolor = ;
>>> 'IIF(myTbl.sum = 6 ,RGB(255,0,0),RGB(0,0,255))'
>>>
>>>Grid.Column(n).DynamicBackcolor = ;
>>> 'IIF(myTbl.sum = 6 ,RGB(0,0,0),RGB(255,255,255))'
>>>
>>>The code above would make column(n)'s font color RED
>>>and back color BLACK if myTbl.sum is 6.
>>>
>>>Good Luck .
>>
>>
>>Dear Mr. Park,
>>
>>I came across this little pearl also and naturally tried to massage it a little.
>>
>>Grid.Column(n).Dynamicforecolor = ;
>> 'IIF(myTbl.sum = 6 ,RGB(255,0,0),RGB(0,0,255))'
>>
>>I would like the "rgb(255,0,0)" to be as dynamic as the "myTbl.sum = 6 ". So I created a field in the view that runs the grid to hold the color of the backcolor I would like the field to be displayed in ie:
>>
>>Grid.Column(n).Dynamicforecolor = ;
>> 'IIF(v_apptbookframe.'REC' ,RGB(v_apptbookframe.ccolor_1),RGB(0,0,255))'
>>
>>This doesn't bomb but the grid does not colorize.
>>
>>If you store '255,0,0' to testcolor
>>Then substitute testcolor for the rgb clause ie:
>>
>>Grid.Column(n).Dynamicforecolor = ;
>> 'IIF(v_apptbookframe.'REC' ,rgb(&testcolor) ,RGB(0,0,255))'
>>
>>this runs but then if you try the same thing with the view variable ie:
>>
>>Grid.Column(n).Dynamicforecolor = ;
>> 'IIF(v_apptbookframe.'REC' ,rgb(&v_apptbookframe.ccolor_1) ,RGB(0,0,255))'
>>the grid does not get colorized.
>>
>>
>>Any ideas?
>>
>>NeilGorin
>>Dadigidoc@aol.com
>What does v_apptbookframe.ccolor_1 contain ? Char or numeric ? If char like "255,255,0" then try :
"iif(v_apptbookframe.REC, rgb("+v_apptbookframe.ccolor_1+"),rgb(0,0,255))"
Else try with str(v_apptbookframe.ccolor_1) instead of RGB().
>You cannot macro substitute like &v_apptbookframe.ccolor_1. If you want to evaluate that way then try :
"iif(v_apptbookframe.REC, eval('rgb('+v_apptbookframe.ccolor_1+')'),rgb(255,0,0))"
Cetin




Hi Cetlin,

v_apptbookframe.ccolor_1 is char ie: 255,0,0

It did not work.

My code is:
this.column2.dynamicbackcolor = ;
"iif(.t., rgb(" + v_apptbookframe.ccolor_1 + " ),rgb(0,0,255))"

Program did not bomb but the grid did not colorize. Any other suggestions??

Thanx Neil
DaDigiDoc@aol.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform