CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    PLay WAV ONLY once on MouseMove...How?

    I know it's easy but I just can't get it ..(I got it before to work, but something is wrong with me I guess....forgot!


  2. #2
    Join Date
    Oct 1999
    Location
    CA
    Posts
    91

    Re: PLay WAV ONLY once on MouseMove...How?

    I had a similar problem in Access. I wanted to set another object to visible when the control was passed over. And what happened was the other object (a square) would flicker for each movement of the mouse. I had several objects, each of which displayed a different square when passed over (and disappeared again when over another control or the form). I created a string that would be assigned the name of the control when the mouse entered it. I also had a sub that would make all the objects invisible, but I doubt you would need anything like that (mabey to stop another wav from looping).


    Sub Object_MouseOver(...........)
    ...
    If strCurrentControl <> Object.Name then
    strCurrentControl = Object.Name
    ... Call ClearAll Sub
    ... Play sound, or in my case, make objects visible ...
    ...
    End If
    ...
    End Sub
    'Note: I used this code in every object, including the form. If you don't,
    ' you can move the mouse on and off the object without re-triggering
    ' the desired effect.





    Brewguru99

  3. #3
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: PLay WAV ONLY once on MouseMove...How?

    Andy,

    Use the code below (Set it accordingly)

    'on top of the form. This is public to form
    Dim Played as Boolean
    'In form load event
    Played = false

    'on form_mousemove event
    if not played then
    'Andy do what ever you do... :-)
    '...
    '...
    Played = true
    end if




    I hope that work.

    regards,

    Santulan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured