Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change the color of particular grid cells?
Message
 
To
20/09/1997 04:25:37
Ron Tse-Jung Huang
Leader Professional Consulting
Shin-Chu, Taiwan
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00050890
Message ID:
00050934
Views:
23
>Wishing the fore color in a column will be turned to red when the associated values are in a fixed range.
>I know setting the dynamicforecolor will do. However, it seems to set the color of the whole column, instead
>of the cells that fall in the range.
>
>What can I do with this?
>
>Many thanks!
>Best regards,
>Ron.

Ron, you need to use the IIF() function when setting the DynamicForeColor. Check the help system under DynamicForeColor for more details. I copied their example below:
frmMyForm.grdGrid1.SetAll("DynamicBackColor",;
   "IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255), RGB(0,255,0))", "Column")
** Alternate white and green records
In your case, you'd replace the Mod(recno() ) code with code that sets the range you want.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform