How do I kill a playloop when a thread is killed?
Meet Thread:
public void TimerFunc(){
...
while (true)
{
...
sound.PlayLooping();
// Displays the MessageBox and waits for user input
MessageBox.Show(message, caption, buttons);
// End the sound loop
sound.Stop();
...
}
}
Thread gets started by a button in the main interface, and can get killed
by a button in the interface.
How do i get the soundloop to stop if the thread gets killed when waiting
for user input?
No comments:
Post a Comment