Sub App_Start
Form1.Show
Hardware1.New1
timer1.Interval = 5000
timer1.Enabled = true
Msgbox("Some Message","title",cMsgboxOK)
timer1.Enabled = false
End Sub
Sub Timer1_Tick
Timer1.Enabled = False
Hardware1.KeyPress(13)
End Sub
@Erel,
How is this possible?
I would have expected to need DoEvents or Agraham's Threading library as I thought the MsgBox would normally halt program execution.
Yet it is obvious here that the Tick events are still caught even though the program is in the middle of running App_Start.
While the main (and only) thread waits for the msgbox to be closed it is free to handle other events.
Most user events will not happen as the form and all its controls are blocked until the msgbox is closed, however the timer continues to raise events.
While the main (and only) thread waits for the msgbox to be closed it is free to handle other events.
Most user events will not happen as the form and all its controls are blocked until the msgbox is closed, however the timer continues to raise events.
Ah, I see now, rather too late, that I should have written a local wrapper Sub for MsgBox() calls that stopped my constantly-running timer while the message is shown, so that the program does not have to deal with the accumulated (and now useless) queued timer events afterwards!
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.