>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)
The proper Windows way of doing this is to have the field select on entry. (set the SelectOnEntry property). Then, the colors the user has chosen will be used.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer