Typically, to determine when a UserControl gains and loses focus,
you might think to use the standard GotFocus and LostFocus events.
However, in UserControls these two events aren't always reliable.
There are situations where a control will lose the focus without
firing the LostFocus event (for example, when Alt+Tabbing to
another application), and also get the focus without firing the
GotFocus event. As a result, your best bet for monitoring the
focus status is to insert code in the UserControl's EnterFocus
and ExitFocus events.