If you mean that you do not get Lost_Focus when you switch to another application then that is by design. You get Lost_Focus only within the VB application.
If you mean within the VB application then VB Baisc Concepts explains:
"Note A form can receive focus only if it doesn't contain any controls that can receive the focus."
My corollary frim actual test is
"Therefore the form lost_focus will not be fired if the form never had the focus."
The event will fire only under certain conditions, mostly when moving to controls on the same form. In the IDE, when stepping through code, you may never see it fire, or it may never fire at all, or fire when you didn't expect it.
If you want a more sure way to validate a control, then use the validation event and make sure all other controls have the property "CauseValidation" set to true. Even then, the cause validation event may not fire, especially when clicking another form or the MDI form menu or tool bar - this is not just by design - but a must. I wouldn't expect, or even want it to be different.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.