0

Hi guys.

Im trying to get a wav file to play on a mouse over event.
I want a wavefile to play when the mouse pointer moves over a label and stop wen it is moved off the label.

I believe this can be done using the sndPlaySound, i have tried and the wav does play, but i need it to stop if the mouse is not on the label.

Thanks in advance.

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by splitfinity
0

I don't know if this is very effective.

My theory is that if the label detects a mouse_move event then it starts playing. when the mouse moves anywhere else on the form, then stops playing.

So maybe add a mouse_move event on the form it self to stop the music playing

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Debug.Print "stop playing"
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Debug.Print "play"
End Sub
0

Hi, thanks for reply, but it seems to be working when i added the ffg:

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
sndPlaySound vbNullString, SND_NODEFAULT
End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.