Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids and text boxes
Message
De
28/07/2000 09:38:59
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
27/07/2000 14:26:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397698
Message ID:
00398122
Vues:
33
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform