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

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
 
J

John Cottrell

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. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top