From: jp2msft on
I have several panels in my application that I use as screens.

On Load, each panel's Dock property is set to Fill, I call BringToFront()
for my first panel, then call its Focus() method.

Based on Operator selection, different panels are brought to the front and
given focus.

I have noticed that the first time a panel is given focus, the GotFocus()
event is fired and my GotFocus event handler is called. This is very
important for some of my panels, because it handles setting up the panel
before it is displayed.

However, after a panel's GotFocus event handler has been called and I go to
another panel, calling the previous panel's BringToFront() and Focus()
methods do not appear to fire my GotFocus event handlers. The panels are
still brought to the front and focus seems to have been given to them, though.

Is there a "dirty bit" that I need to clear so that calling Focus() will
generate the GotFocus event every time?

What am I doing wrong?