943,800 Members | Top Members by Rank

Ad:
Jul 23rd, 2008
0

Mouse Over Sound Event

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
splitfinity is offline Offline
5 posts
since Jul 2008
Jul 23rd, 2008
0

Re: Mouse Over Sound Event

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

VB Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
bushman_222 is offline Offline
65 posts
since Jan 2008
Jul 23rd, 2008
0

Re: Mouse Over Sound Event

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
splitfinity is offline Offline
5 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: 554 message rror
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Voice Recognition System





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC