Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and text boxes
Message
From
28/07/2000 09:38:59
John Baird
Coatesville, Pennsylvania, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00397698
Message ID:
00398122
Views:
24
>>Hi all:
>>
>>I have a grid with a couple of text boxes that hold cost, price, and available. I retrieve live-price information and need to indicate the changes by changing the background color of the text box.
>>
>>If the cost goes down, the background should change for that particular textbox to green.
>>
>>The problem i'm having is when I change the backcolor property, the textbox background stays white unitl i select the textbox. How can I have that particular box show green background whether selected or not?
>
>Subclass the textbox, and add an assign method to the value property; in the value_assign, add the following code before assigning the new value passed in to the property value:
>
>
IF m.NewValue < this.value
>   this.backcolor = RGB(0,255,0)
>   this.disabledbackcolor = RGB(0,255,0)
>ELSE
>   this.backcolor = RGB(255,255,255)
>   this.disabledbackcolor = RGB(230,216,174)
>ENDIF
>=this.refresh()
This is a great example. Would never have thought of doing it this way, unfortunately, the textbox still stays white. I have implemented it using the DyanmicBackColor and seems to work okay.

Thanks again for all the help.
Previous
Reply
Map
View

Click here to load this message in the networking platform