
Strange control event behaviour
Quote:
> Hi,
> I am experiencing some very strange happenings in VB5 (service pack 3)
apps
> running under Windows 95 and Windows NT (service pack 3). The
application
> are form based apps capturing data into DAO databases. Everything works
> fine when run in the development environment but things get seriously
> erratic when the executable is run (compiled to native code).
> When tabbing from one text box to another, the GotFocus event of the
control
> I am tabbing into occurs before the LostFocus event of the control I am
> tabbing out of.
That's normal and expected. You can't lose focus until someone else has
got it.
Quote:
> Also MSMask controls seem to fire their GotFocus events
> twice in succession when I tab into them. I have tried numerous DoEvents
> and even API Sleeps to try and resolve this but no joy.
I never use 'em, so I can't comment.
Quote:
> Could the problem lie in the fact that I am launching many message boxes
> from the focus events of my controls?
Yep: that could be a problem. Messageboxes mess up the event sequence
sometimes, especially with regard to focus events.
Jim Deutch
MS Dev MVP