Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make the whole row of the grid to use the same forecolor
Message
From
02/07/2001 04:18:02
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00525731
Message ID:
00525768
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

Control in the active cell is displayed by the color of the main control in column. If column property Sparse is set to .F., the color of the main column control is displayed in the entire column and Dynamic* property expressions have no effect here except DynamicCurrentControl.

What I want to say is to explain more Nick's suggestions about DynamicCurrentControl.
There are solutions for sparse = .F. and for sparse = .T.

With sparse=.T., you require to set up the colors of the main column control (usually textbox). Current cell colors for active cell are used from this control.
Setting up this in GotFocus should work! I did met the same situation when setting colors in GotFocus event makes no difference. After some investigation, I discovered code in my classes that set up colors too overriding whatever was set in the GotFocus event. Just check this out accurately.
You can, of course, use DynamicCurrentControl in such case and have 2 controls in your column with different colores and use one or another depended on the status field. However, such grids work slower.

With Sparse=.F. you require to have 2 different controls anyway. 1 is for current row and another for displaying all other rows. In DynamicCurrentControl property put the expression to call custom method. In custom method (it is called for each grid row refreshing) return the name of the control depended on the current row. For control that will be displayed in the row at the moment that procedure called, set colors properly. 2 controls are required because with sparse=.F. in case you use custom refreshing of control for each row VFP shows the appearance of the last visible row in current cell. In other words, after grid refresh finished, last control colors set are used for current cell.

Thats all on this topic ;)

Take a look also to the FAQ#8092 (Auto-link do not works??? Look here: How to make a grid appear like a list similar to list box), it might be useful because it shows read-only grid with current row highlighting and without any defects related to th current cell.

HTH.

>Hi everybody,
>
>I have a grid, in which I set dynamicforecolor for all columns depending on status field value, e.g.
>
>.setall('DynamicForeColor', "thisform.myforecolor(BldMstr."+thisform.AddrField+")", 'Column')
>
>It sets correctly the dynamic forecolor except for the active column. In other words, if I set dynamic forecolor to blue, all columns show blue forecolor, but the active one shows black. Is it possible to make it blue too?
>
>Thanks in advance.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform