I created a usercontrol in c#, Leave and LostFocus are not fired if I switch to another program. How can I detect if the app loses focus?
Try your mainform's Deactivate event