Mouse Over Sound Event

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2008
Posts: 5
Reputation: splitfinity is an unknown quantity at this point 
Solved Threads: 0
splitfinity splitfinity is offline Offline
Newbie Poster

Mouse Over Sound Event

 
0
  #1
Jul 23rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 65
Reputation: bushman_222 is an unknown quantity at this point 
Solved Threads: 4
bushman_222's Avatar
bushman_222 bushman_222 is offline Offline
Junior Poster in Training

Re: Mouse Over Sound Event

 
0
  #2
Jul 23rd, 2008
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

  1. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2. Debug.Print "stop playing"
  3. End Sub
  4.  
  5. Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  6. Debug.Print "play"
  7. End Sub
Last edited by bushman_222; Jul 23rd, 2008 at 11:03 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 5
Reputation: splitfinity is an unknown quantity at this point 
Solved Threads: 0
splitfinity splitfinity is offline Offline
Newbie Poster

Re: Mouse Over Sound Event

 
0
  #3
Jul 23rd, 2008
Hi, thanks for reply, but it seems to be working when i added the ffg:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2. sndPlaySound vbNullString, SND_NODEFAULT
  3. End Sub
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC