Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One of those SetAll problems
Message
From
03/10/2005 06:31:11
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01055445
Message ID:
01055448
Views:
10
Terry you miss the close bracket of ALLTRIM(STR(ln...))
Try with:
  .grdGrid1.SetAll( "DynamicBackColor", ;
                     "IIF( RECNO( ) = " + ALLTRIM( STR( lnTableNum) ) + ", RGB(255,255,255), RGB(0,255,0))", ;
                     "Column")  && lnTableNum in this example = 5
  .grdGrid1.Refresh()
>I'm writing a times tables prog for my daughter, that successively asks, in a dialog "What is X times Y?", where X is a random no from 1 to 10, and Y is the selected table, from 2 to 10. If the answer is wrong 3 times then the subject table is to be highlighted.
>
>Now, all the tables from 1 to 10 are displayed in a grid, and the idea is to highlight the row containing the subject table. The grid's source is a table of fields called "one", "two", "Three", etc., to "ten". So the 5th record is the 5 X table, so field "one" is 5, field "two" - 10, "three" - 15 etc.
>
>The grid is initially displayed in ledger format, to aid reading, alternating rows in green or white. Given an erroneous answer I want all the grid plain but with the offending row in a different back colour.
>
>So a grid column's DynamicBackColor property initially is:
>
>IIF(MOD(RECNO(),2)=1,RGB(255,255,255),RGB(192,220,192))
>
>But on error I have:
>
>
>  .grdGrid1.SetAll( "DynamicBackColor", ;
>                     "IIF( RECNO( ) = " + ALLTRIM( STR( lnTableNum) + ", RGB(255,255,255), RGB(0,255,0))", ;
>                     "Column")  && lnTableNum in this example = 5
>  .grdGrid1.Refresh()
>
>
>Anyway, nothing happens, and the grid remains ledger. I've tried scanning through the table to no avail.
>
>Maybe the grid's default DynamicBackColor is overriding this.
>
>Any ideas?
>
>'ppreciate it.
>
>Terry
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform