How can my Winform app tell when it loses focus to another app?

  • Thread starter Thread starter RJ
  • Start date Start date
R

RJ

This is an MDI app. Form Leave, Deactivate, etc don't seem to work.
Multiple child form Leave, Enter events fire when you just switch child
forms.
I need a way for the application to know it is not the one with the focus.
Also, it might be good for the app to know when it does get focus again. I
was hoping not to resort to Win32 API and Windows messages.
Thanks for ideas.

RJ
 
Your application could use a Timer and then in the Tick
event you could test the form's Focused property to
determine if it has focus or not.

This may not be the best method but it should work. :-)
 
Back
Top