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!
Printable View
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!
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
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