|
-
Dec 10th, 2003, 11:38 PM
#1
Thread Starter
Junior Member
Threading problem - resolved
I am creating a new thread in my form1 class.
I am counting down a timer, the thread starts when the timer stops and plays an alarm sound. I have a "snooze" button, well, I think you understand what I'm trying to accomplish.
When I start the thread, all goes well, I can stop it also with "threadname.abort", but this kills it so I cannot restart the thread. If I use "suspend", the program throws an exception claiming the thread is not running, but I know it is, it plays a sound in a loop. Any suggestions to better handle this?
Last edited by skid2964; Dec 11th, 2003 at 10:14 PM.
-
Dec 11th, 2003, 02:50 AM
#2
Sleep mode
What about using the static Sleep() method :
VB Code:
Thread.Sleep(millseconds)
-
Dec 11th, 2003, 10:16 PM
#3
Thread Starter
Junior Member
Resolved .... I suspend the thread, then when I need to restart it, I use an if statement to check its status using "isAlive", if true I resume instead of start.
All is well ....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|