When is the LostFocus event actually fired?

Hello!

In the documentation it reads "Occurs when the control loses focus". As far as I understand e.g. a TabPage's LostFocus event should fire when focus leaves the page, e.g. by putting focus at anoter page or outside the TabControl. I suppose I may explicitly assign focus at a control by clicking on it with the mouse (under the assumption it's enabled and so on), but the TabPage's LostFocus event doesn't fire in this case?

Shouldn't the TabPage LostFocus fire in such a case or do I miss something?
Best regards,

Henrik Dahl

[546 byte] By [HenrikDahl] at [2008-2-26]
# 1

Rarely should the LostFocus and GotFocus events be used, hence why they don't show up in the designer.

Instead use the Enter and Leave events. Leave will fire when you leave a tab page or a control that is contained on the tab page.

DavidM.Kean at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
It works excellently, thank you very much!
Best regards,

Henrik Dahl

HenrikDahl at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
It's just a pitty that the Leave event does not exist in the Compact .NET Framework, whereas the LostFocus event does.
Best regards,

Henrik Dahl

HenrikDahl at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...