I can use the Control.Enter and Control.Leave events to detect when user focus enters or leaves a control, but this only works on a per-form basis. I use more than one form in my application, and want to track which control has user focus, I have to use the forms' Activated and Deactivated events to track which form is active and then track which control is focused within each form.
We're building a client using the DockPanel suite, so we don't have direct access to the controls' forms. We can't just add listeners to the control's top-level form because that changes when the user docks or undocks the panel. But we still need to track focus on a per-application basis. How do I detect control entering/leaving on a per-application basis, without access to the control's form?