Using Timer To Close MsgBox?

cdeane

Member
How can I close out a MsgBox after 5 sec. of show time?
 

RandomCoder

Well-Known Member
Licensed User
@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. :confused:

Regards,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Thanks for the response, I understand now.
 

mjcoon

Well-Known Member
Licensed User
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!

Mike.
 
Top