>Hi all. Im building a small app for a visually impaired person and would olike to know how to change the backcolor of a cell in a grid depending upon its value. There would be 4 possible different values but it can work like "red if value=x, green if value<>x".
>TIA
>Ulises.
If there are only two cases, you should use column1.DynamicBackColor="iif(myTable.MyField=x,rgb(255,255,255),rgb(128,128,128)).
If there are bunch of cases, create a method of your form, called MyColor
column1.DynamicBackColor="thisform.myColor(MyTable.MyField)"
and put this code into MyColor method:
lparameter tValue
local lnColor
do case
case tValue=x
lnColor=rgb(....)
case tValue=y
lnColor=rgb(...)
etc...
endcase
return m.lnColor
If it's not broken, fix it until it is.
My Blog