Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicForeColor property
Message
 
À
30/04/1998 03:07:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00095870
Message ID:
00096006
Vues:
52
Hi Cetin & Jess,

Thanks for your replies. I have had to do this programatically, and it DOES WORK - just erratically and unpredictably for the most part.
Eg:
this.grdSked.colname.dynamicforecolor='iif(subs(thisform.grdSked.colname.text1.value,1,1)="0",rgb(200,0,0),rgb(0,200,0))'

This is a simplified example I used for testing purposes and it works but the active cell and surrounding cells are SOMETIMES the wrong colour.

The problem gets worse when I apply the code to the remaining 210 columns!
I'm starting to believe this is a bug in VFP.

Ashley



>>I'm trying to set the cells in a grid to different colours based on their value.
>>So far I'm getting erratic results where (apparently) random cells are changing color when scrolling a line or cell at a time, sometimes effecting the whole column or neighbouring cells. I've tried refreshing the grid with no effect.
>>I've tried the odd/even record example and that works fine, it just does not seem to to work properly at the grid.column.text.value level.
>>
>>Any suggestions?
>>
>>TIA
>Ashley,
>Dynamicback or forecolor also work with value level but setting the correct expression is sometimes tricky. Try the following example that changes backcolor in a buffered table based on value change (edited fields and newly appended recs have red backcolor).
*Grid.init
>for ix = 1 to this.columncount
>    with this.columns(ix)
>      cField = substr(.controlsource,rat(".",.controlsource)+1)
>      .DynamicBackColor = "iif(oldval(["+cField+"])#"+cField+" or recno()<0,"+;
>			str(rgb(255,0,0))+","+str(this.backcolor)+")"
>    endwith
>endfor
>Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform