Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and text boxes
Message
From
27/07/2000 14:26:44
 
 
To
27/07/2000 12:44:57
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00397698
Message ID:
00397777
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()
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform