Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternate color columns in a Grid?
Message
From
08/11/2004 08:00:45
 
 
To
06/11/2004 05:12:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00958685
Message ID:
00959106
Views:
17
This message has been marked as the solution to the initial question of the thread.
Add a property lSw and a method ChangeSw to your form.

*ThisForm.ChangeSw
With This
    .lSw=Not .lSw
    return .lSw
EndWith
*ThisForm.YourGrid.Init - for a chess pattern
This.SetAll("DynamicBackColor", "iif(ThisForm.ChangeSw(),"+lcColor1+","+lcColor2+")", "Column")
*ThisForm.YourGrid.Init - for a jail pattern
For each col in This.Columns
    col.DynamicBackColor=iif(mod(col.ColumnOrder,2)=0, ;
          "iif(ThisForm.ChangeSw(),"+lcColor1+","+lcColor2+")", ;
          "iif(Not ThisForm.ChangeSw(),"+lcColor1+","+lcColor2+")")
EndFor
I leave the rest to you. Do not forget to instantiate lcColor1 and lcColor2.

Later edit: I forgot to mention there is a catch: a small bug(caused by scrooling in VFP7 with sp1) that make sometimes that only 2 adiacent rows in jail pattern to have the same color.
Mecu Sorin
mecusorin@spymac.com
There is no spoon! Use your hand.
Previous
Reply
Map
View

Click here to load this message in the networking platform