Eitan wrote:
Hello,
The Leave on the Tab Control is not triggered when I press one of the
controls on the ToolStrip..... It only triggers when I switch between tabs
on the Tab Control....
But do you not get an Enter event for the ToolStrip?
It seems to me that if you don't get a Leave event for the Tab Control,
the technically the Tab Control hasn't actually lost focus. So in some
respect, you are asking the wrong question. Perhaps you should look
more closely at what UI changes actually occur when what you think is
focus changing happens.
All that said, there's always the WndProc. You can override the WndProc
for the Tab Control and see what messages are sent when the UI changes
in the way you want to detect (for example, use Debug.WriteLine() to
trace the message values). Then you can either take advantage of that
information to find a managed way to handle the change, or just keep the
WndProc overridden and watch for those same messages.
Pete