Actually- I should have said Form-level variable.
at the top of your form, underneath the Class declaration (Class Form1) but before any other code.
Private mTerminateThread as Boolean
this makes the variable available to all procedures in the form.
this way, in the thread you wish to terminate, you simply loop on mterminatethread:
Do While(mterminatethread)
'thread code...
Loop
Additionallu, if you're playing the sounds in the background in your thread, it won't work, since control will be returned before the sound finishes. If you are making it a separate thread (I might also mention that I have NEVER used a separate thread for ANYTHING, and have made a fair number of applications that less Single-thread savvy programmers would use hundreds of threads for.
Also, threads make everything a giant PITA to debug.
Anyway... where was I? Oh yes, if you're making it a separate thread, there is no need to ensure the thread keeps running. Instead of running the sound in the background, you should play is synchronously.