Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MouseMove Event 2

Status
Not open for further replies.

426Hemi

Technical User
May 2, 2002
16
US
This may be a simple question, but is there an easy way to attach a mouse event to a control such a a MouseMove event that will change the ForeColor of a control's text (such as a caption on a button) and revert back to the original color when the mouse moves out of the area of the control (Just like a MouseOver and MouseOut event in Javascript). I tried the MouseMove event on a control, and was able to make the color change when the mouse passed over the button, after which it stayed at the "highlight color" that I had chosen. Is there a way to make it change back after the mouse passes over? This is a simplistic thing I think but I am a beginner at VBA and have not yet found the solution and do not yet have a reference book research it. Thank you!
 

Sort of goofy but my only thought is by using the mousemove event of the object when the mouse moves out of the control in question to reset. This would more common than not be the form mousemove event unless your controls are really close together that the form will not fire the mousemove event in which case you would want to use the mousemove events of those controls directly around the control to reset it.

Not the best way in the world.
 
Thanks to Jitter, that idea actually does work. But until I get better at VB, there must be an easier way to apply a rollover to each button instead of writing a MouseMove event into each control. Again, thank you for your input. I will check out the website....Looks good so far, thanks for the tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top