View Full Version : highlight form control


Stew
01-12-2001, 10:32 AM
I want to highlight the control on a form which has the focus so users can easily identify where they are on a form. I know how to do this - I have a function which, when called from the GotFocus event, changes the background of the control to yellow. The problem is I want an easier way to call the function then having to place the code to call the function on the GotFocus event of every control on every form. That's a lot of lines of code floating around for each form. Any suggestions would be appreciated.

Pat Hartman
01-12-2001, 04:29 PM
You need to execute your function at the point in time when a control gets focus. The only time you know that is in the GotFocus event of each control. So, the short answer is, you'll have as many calls to your function as you have controls that you want to use it from. Windows is an event driven program and this is the price you pay.