Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Color for Grid
Message
From
01/05/2002 09:07:49
 
 
To
01/05/2002 08:35:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651265
Message ID:
00651275
Views:
18
Steven,
Try the following:
lcRed   = LTRIM(STR(RGB(255,0,0)))
lcGreen = LTRIM(STR(RGB(0,255,0)))
lcBlue  = LTRIM(STR(RGB(0,0,255)))
lcBlack = LTRIM(STR(RGB(0,0,0)))

*-- pseudo code
*IIF(HighPriority, red, IIF(MediumPriority, blue, IIF(dmDate<DATE(), green, black)))

foreexpr = 'IIF(ALLTRIM(myscLoc.priority) == "High"  , ' + lcRed   + "," +;
           'IIF(ALLTRIM(myscLoc.priority) == "Medium", ' + lcBlue  + "," +;
           'IIF(myscLoc.dmdate < DATE()' + ","  + lcGreen + "," + lcBlack +;
           ')))'

THIS.SETALL("DynamicForeColor",foreexpr,"Column")
HTH
>Can someone help me with this code. I want to display the text in a row as green if there is no priority and date is past due. The following code leaves all the rows black.
>
>foreexpr = 'IIF(ALLTRIM(myscLoc.priority) == "High",' + LTRIM(STR(RGB(255,0,0))) + ',IIF(ALLTRIM(myscLoc.priority) == "Medium",' + ;
> LTRIM(STR(RGB(0,0,255))) + ',IIF(myscLoc.dmdate) <' + DTOC(Date()) + ',' + LTRIM(STR(RGB(0,255,0))) + ',' + LTRIM(STR(RGB(0,0,0))) +')))'
>
> THIS.SETALL("DynamicForeColor",foreexpr,"Column")
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform