p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual Basic 2010 General Discussion (http://p2p.wrox.com/forumdisplay.php?f=580)
-   -   (Advanced) Close window opened in another thread (http://p2p.wrox.com/showthread.php?t=92263)

mike_abc February 24th, 2014 09:05 AM

(Advanced) Close window opened in another thread

I use an additional thread (thread_2) in my code to set a boolean variable which is periodically sampled and closes the main thread if true. The user interface for the thread_2 is a MsgBox which pops up at the beginning of the main thread - and should be pressed if the user wants to stop the main thread.

When the main thread finishes, thread_2 is killed (t.abort; t = Nothing), but the MsgBox does not disappear, so the user has to press the MsgBox anyway.

Question: How do I kill the msg box when the main thread finishes ?

I tried using a "normal" window (with a button) to do the same thing, but I couldn't close it from the main thread either.

Any ideas ?


All times are GMT -4. The time now is 09:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.