Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait Window causes Activate Event to fire???

Status
Not open for further replies.

ScottMcVt

Programmer
Apr 11, 2001
8
US
A colleague of mine insists that when you put a "wait window timeout .005" or "inkey()" statement in method code of a form, it will cause the activate event to fire. I tried to verify this claim by using the event logger and I saw no evidence of the activate event firing. I say he's full of baloney. Can anyone shed some light on this for me?

Thanks,
Scott McWherter
 
If you have a wait window with text that actually shows up. It gets focus. I belive that will cause both the deactivate and the activate events to fire. Inkey should have no such effect however. Also a wait window with no text like you have above should not cause activate to fire since no other window is actually created.
 
Why not put code in the activate events that shows you if it will fire or not.

I concurr with fluteplr , when a form looses focus, the deactivate event is fired. When the form receives focus again the activate event is fired.

HTH,
Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Scott, I guess this is depended on the form. Is the form modal or modeless? Is it Top-level form? etc etc.

PS: WAIT WINDOW TIMEOUT 0.005 - this makes no sense, because the minimum value of timeout is 1 (1 second). Try with 1 second instead of 0.005. To delay program a bit use Sleep() API function:

DECLARE integer Sleep in Win32API integer
Sleep(5) - sleep for 5 milliseconds.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top