Rune
Rune

Reputation: 832

How to detect application activation

I need to perform some action when my application receives focus.

I've tried hooking both GotFocus- and Enter-events, but they only trigger when focus changes within my application.

Scenario is that my application detects some problem that must be resolved elsewhere, and I would like to do the check again when the user goes back to my application.

Upvotes: 2

Views: 180

Answers (2)

ICR
ICR

Reputation: 14162

Try hooking the Activated event.

Upvotes: 1

Charlie
Charlie

Reputation: 45052

I would try overriding Form.OnActivated (or handling the Form.Activated event) in your application form.

Upvotes: 4

Related Questions