Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Color in Grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00244921
Message ID:
00244968
Views:
24
>>I have a grid on a form that sets the dynamicbackcolor and dynamicfore color in the init event of the grid as follows:
>>
>>public grno
>>grno = recno()
>>this.setall('DynamicBackColor','iif(recno()=grno,rgb(128,128,255),rgb(255,255,255))','Column')
>>this.setall('DynamicForeColor','iif(deleted(),rgb(255,0,0),rgb(0,0,0))','Column')
>>
>>In the afterrowcolchange event I have:
>>
>>grno = recno()
>>this.refresh()
>>
>>The results of this is that when the user moves through the records in the grid the entire row shows with the background color (128,128,255) and all the rows have the fore color of 0,0,0 except for deleted records which are 255,0,0.
>>
>>All of this is fine until the user clicks in the grid. When they click the back color changes to white(255,255,255) and the fore color to black (0,0,0). Is there a way to make the colors stay the same as what is set dynamically?
>
>If you're allowing users into cells and want to keep the colors when in cell, you can use textbox Gotfocus...something like
>
>this.backcolor = appropriate color
>this.forecolor = appropriate color


Thanks Bruce, that does what I want.
Mark Johns
Previous
Reply
Map
View

Click here to load this message in the networking platform