Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine X,Y of grid for DynamicBackColor
Message
From
10/12/2003 10:21:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/12/2003 08:33:56
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00857594
Message ID:
00857659
Views:
20
>I am trying to set the BackColor of a grid cell based on a calculated value (similar to FieldState). I currently have the calcualted values in an array with one element corresponding to each field in the cursor. My idea is to put a function in DynamicBackColor that uses the grid's X,Y position to refer back to the associated array. Is this feasible? If not, I am open to suggestions.
>
>TIA,
>Larry Long

Larry,
Why don't you do it in an easy way. Create a custom method to return the backcolor and set that custom method as the dynamicbackcolor's function. ie:
*Form.MyColor
lparameters tcControlsource
lnRecno = recno() && Y
if lower(justext(tcControlSource)) == 'myfield' && X
* You might get column index position into array from field()
* But keeping an array doesn't look very feasible thinking array limits
* if limits are OK would be fast
*....
return lnColorCode

*Grid.init && Or anywhere like a commandbuttonclick
with this
 for ix=1 to .Columncount
   .Columns(ix).DynamicBackColor = ;
     "(thisform.myColor('"+.Columns(ix).Controlsource+"'))"
 endfor
endwith
PS:You might also try varread() as the Y component.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform