Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with grid cell color
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00366320
Message ID:
00366527
Views:
16
Eric & Arne,
Copy and paste the following code into a PRG and run it. This demonstrates the effect I'm referring to:

create cursor crsSample (cDummy C(1), cColor C(5))
appe blan
repl cColor WITH 'Red'
appe blan
repl cColor WITH 'Green'
go top

oForm = create('ShowColor')
oForm.Show()

define class ShowColor as form
WindowType = 1

proc init
this.addobject("grdColor", "grid")
this.grdColor.RecordSource = "crsSample"
this.grdColor.Column1.ControlSource = "crsSample.cDummy"
this.grdColor.Column2.ControlSource = "crsSample.cColor"
this.grdColor.Column2.DynamicBackColor = ;
"IIF(crsSample.cColor = 'Red', RGB(255,0,0), RGB(0,255,0))"
this.grdColor.Column2.SelectOnEntry = .F.
this.grdColor.Visible = .T.
endproc
enddefine
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform