Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set DynamicBackColor by Group
Message
 
To
09/04/2005 23:57:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01003119
Message ID:
01178305
Views:
12
Dragan - i'm doing something similar... using...
  .dynamicbackcolor="ncolor"
I am using memoeditboxes in the grid columns instead of textboxes. Not sure if thats the problem but i dont see the color. I've tried setting the memoeditboxes' BACKSTYLE to TRANSPARENT thinking that would let the assigned color show, but no joy.

The cursor is populated and the nColor1 field is set w/ the code below, and the dynamicbackcolor is assigned using...
thisform.grd1.column2.DynamicBackColor = "tmpweek.nColor1"
'nColor1' field assignment code....
lnretval = rgb(255,255,255)
DO CASE
   *--- zero payed
   CASE lcTotPaid = 0
      lnretval = rgb(255,255,255)
   *--- existing balance
   CASE lcBalance > 0
      lnretval = rgb(255,255,128)
   *--- payed in full
   CASE lcTotCost = lcTotPaid
      lnretval = rgb(128,255,128)
ENDCASE
RETURN lnretval
The nColor1 assignment code works and i can browse the table and see the numeric value set by the RGB code above. Any ideas?



>>>Hi,
>>>Just pass the field to the function, VFP will evaluate runtime
>>>
>>>What error message you get?
>>
>>John,
>>
>>In the Function, your CASE statements refer only to FIXED values "0001" and "0002" for UPSINO. UPSINO is the ID number for a piece of equipment. It could have a value of any string up to seven characters. So I can have a UPSINO that looks like "TC00001" "TC0002" , or even "LTC00045", "LTC00046", etc. And in the resulting cursor, there will be multiple lines for any one of these UPSINOs. So I want to alternate like "green bar" paper, but not by every other row, rather alternate when the UPSINO changes each time in the resulting grid.
>>
>>In the function you describe, it looks like you want me to make a CASE statement for every possibility of UPSINO.
>>
>>Am I totally missing it or what?
>
>OK, then here's a better one: add one integer field to your cursor and let's name it nColor. For each group you can assign it a RGB number of your choice. You can alternate two colors, or n colors - whatever you like.
>
>Something like this:
>
>
n=0
>dimension aColors[4]
>aColors[1]=0xFFFFFF
>aColors[2]=0x00FFFF
>aColors[3]=0xE2E2E2
>aColors[4]=0xFF7fFF
>
>set order to upsino
>locate
>do while !eof()
>   n=n+1
>   if n>4
>      n=1
>   endif
>   c=upsino
>   replace nColor with aColors[n] while c=upsino
>enddo
>
>Then have
>
>.dynamicbackcolor="ncolor"
>
>...and there you are. No expressions to evaluate, no functions to call.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform