Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to NOT change DynamicBackColor
Message
From
23/02/2005 19:34:45
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
23/02/2005 02:58:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00989507
Message ID:
00989907
Views:
35
>>this.column4.DynamicBackColor = 'iif(duedate < DATE(),RGB(255,50,50),this.column4.DynamicBackColor)'
>
>Try this instead:
>this.column4.DynamicBackColor = 'iif(duedate < DATE(),RGB(255,50,50),'+this.column4.DynamicBackColor+')'
>
>This is assuming, that this.column4.DynamicBackcolor is already set to some expression resulting in a color.

That's exactly what I meant to suggest.

>If it get's too complex, maybe create a function in the form, that you call from DynamicBackcolor:
>this.column4.DynamicBackColor = 'thisform.columncolor(duedate)'
>
>* thisform.columncolor method:
>LPARAMETERS tdDueDate
>...
>Return RGB(...)

I've seen this used, even at framework level, but if the grid has a sufficient number of rows, method call overhead can make grid refreshes slow. Most probably nothing to worry about on today's machines, but just try that with debugger open... it won't matter whether you have the coffee ready, you'll have time enough to brew some.

The fastest trick I've found so far is to add an integer column, let's name it iColor, in the table, and to fill it with rgb() values as needed. Then the dynamic backcolor expresion becomes "alias.iColor" - works like a charm, and you can have as many different colors as you like.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform