Hovering over buttons or other controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to change the appearance of a control if the mouse is hovering over it

Any ideas would be greatly appreciated.
 
See the MouseOver event. You can use it to run code that makes some change
to your control.

Note that you'll need to put code on the MouseOver event of the form's
section that surrounds the control that "undoes" the appearance change.
 
Ken, your answer made perfect sense, so I jumped into an Access database of
mine to play with it. I see no event for Mouse Over in the properties list
of the form in design view, just Mouse Down, Move, and Up. Same in the VB
Editor. Using Access 2002. How do you get to a Mouse Over event?
John Loewen
 
Mike, check my comment that you replied to. I noted there that I see Mouse
Move. That, however, doesn't appear to me to be the same as hovering. If it
is, good . . .

Ah...., I just tried it and it worked. And its not just on Command Buttons.

But adding code to the form's Mouse Move event to reverse the changes to the
controls doesn't work. I set the BackColor of one control to red, and the
Fore Color of another control to red. Once the mouse moves over them, they
change accordingly. But the changes don't revert when the mouse moves over
the form. So how do I undo the control changes when I move the mouse away
from those controls?

Never mind - I just answered that one too. Its not the form's Mouse Move
event that needs the code to reverse those changes, but the Detail's Mouse
Move event.

Thanks, guys! You've been a real help by jiggling new ideas in my mind. Have
a great day!
John Loewen
 
Back
Top