Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BackColor & ForeColor
Message
De
20/08/1998 09:26:36
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00128450
Message ID:
00128458
Vues:
21
Hi Petrus ---

Create a custom TextBox (or whatever) class that has your code in it's Got and LostFocus. Use that TextBox class when adding controls to the form. They will inherit the behavior of the new class.




>I'm busy writing my first application in VFP 5.0a. To make the user interface more user friendly I want to change the BackColor\ForeColor of an object(textbox) from the default(White\Black) to White\Red for the object that has the focus. I eventually got around to doing this by by doing the following :
>
>In the GotFocus property :
>
>This.BackColor = 16777215
>This.ForeColor = 255
>
>In the LostFocus property (to reset to default again)
>
>This.BackColor = 16777215
>This.ForeColor = 0
>
>Is there perhaps a shorter way of doing this other than pasting the code to each object's GotFocus & LostFocus properties? Something like a default setting that applies all the objects on a form even a List Box or a Combo Box. The object that is programmatically entered (a concatenated field consisting of a default value + another field depending on user input) can be manually set.
>
>Any advice will be appreciated.
>
>Petrus.
>(email : CassieC@Transnet.co.za)
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform