If you are using vb express 2005 do this:
Dim done As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If done Then Exit Sub
done = True
My.Computer.Audio.Play("c:\windows\media\Windows XP Logoff Sound.wav", AudioPlayMode.BackgroundLoop)
MessageBox.Show("Now playing Windows XP Logoff Sound.wav")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("button2 clicked - Sound will be turned off")
My.Computer.Audio.Stop()
done = False
End Sub vb 2002 or vb 2003 shouldn't be much different, however they do not use the my keyword.
waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58