Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB4,VB5,VB6
Expertise: beginner
Sep 30, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

The behavior of the LostFocus event depends on VB version

The behavior of the LostFocus event has changed in the transition from VB4 to VB5. Under VB4, if a control on a form has the input focus and the user clicks on a toolbar button, the control fires a LostFocus event. Under VB5 and VB6, the same action doesn't fire any LostFocus event, so you must aware of this detail if you're porting an application from VB4 to a later version.

The behavior under VB5 and later versions is more consistent, because the toolbar should be considered as a sort of menu, and clicking on a menu doesn't raise any LostFocus event, under any version of VB.

Under VB6, however, this action raises a Validate event, so you have the opportunity to execute a piece of code when the focus leaves the control.

Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date