I have a little simple application.. i am running a form, it spawns a thread. When i hit the close button (X) then it disappears, but the program does not close as the thread is still running.
I have come up with a solution to this, where the thread checks if the form is visible or not, if it is not visible, then closes everything. But because the thread only does its job once every 30 seconds, the program may not be cleared for a while.
Question
+dave164 Subscriber¹
Hey all,
I have a little simple application.. i am running a form, it spawns a thread. When i hit the close button (X) then it disappears, but the program does not close as the thread is still running.
I have come up with a solution to this, where the thread checks if the form is visible or not, if it is not visible, then closes everything. But because the thread only does its job once every 30 seconds, the program may not be cleared for a while.
Is there a more efficient way of doing this?
Thanks in advance,
David.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts