GotFocus/LostFocus

  • Thread starter Thread starter Jim Franklin
  • Start date Start date
J

Jim Franklin

Hi,

This might be a silly question but I am confused about one thing:

What exactly defines when a form receives and loses the focus? I have a
continuous main form which contains a number of command buttons which open
other forms on top, some popup, some fullscreen. I want to run some code
that switches off the timer interval whenever another form is opened on top
of my main form, and back on again whenever the main form becomes active
again.

It now works using the Activate and DeActivate events. However I first tries
using GotFocus/LostFocus. Even though the focus was clearly moving from one
form to another and back again, neither of these events fired.

Am I missing something?

Jim F.
 
To add to Larry's comment, a form receives focus ONLY IF there are no
controls on the form that can receive the focus. Using the
Activate/Deactivate events, as you're doing, is the way to handle what you
want to accomplish.
 
Back
Top