Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BackColor & ForeColor
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00128450
Message ID:
00128455
Views:
19
Petrus,

It's a good idea to create subclasses of all of VFP's base classes and create all your controls from the subclass. That way, you could just go into your subclasses and put the appropriate code in the GotFocus() and LostFocus() events. Then all your controls on all of your forms would inherit the new behavior.

>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform