Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two distinct colors in a grid
Message
From
15/06/2004 07:37:45
 
 
To
15/06/2004 01:45:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00913761
Message ID:
00913806
Views:
15
Hi Randy.

Hi. VFP7 user. How do I make 2 distinct (text) colors
in a grid (based on a condition).


It depends. If you want the entire grid row to be a different color, you use code like this in the grid's init()
This.SetAll( 'DynamicForeColor', ;
	'IIF( MyCondition, RGB( 0, 0, 128 ), RGB( 0, 0, 0 ) )', 'COLUMN' )
This.SetAll( 'DynamicBackColor', ;
	'IIF( MyCondition, RGB( 0,255,255 ), RGB( 255, 255, 255 ) )', 'COLUMN' )
If you want only specific grid columns to be a different color, you set up the column's DynamicBackColor property either in the grid's init() in code or in the property sheet like so:
This.Column1.DynamicBackColor = "IIF( MyCondition, RGB(255,0,0 ), RGB(255,255,255) )"
Previous
Reply
Map
View

Click here to load this message in the networking platform