+ Reply to Thread
Results 1 to 8 of 8

Mousemove event

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Mousemove event

    VBA (amateur) issue

    I need your help in the following:

    I have a command button in a form, say "CommandButton1" and I want to change the backcolor of the button into red, when mouse passes over the button. That's the easy part:

    Please Login or Register  to view this content.
    How can the button return to its previous backcolor state, after the mouse left the area of the button?

    Thanks in advance

  2. #2
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Mousemove event

    How about
    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Last edited by zplugger; 02-20-2013 at 10:43 AM.

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Mousemove event

    you could place a slightly large control beneath the button and use that controls's mousemove event to reset the button color. wasted effort in my opinion ;-)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Registered User
    Join Date
    02-20-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Mousemove event

    Sorry but neither worked. btw, Lostfocus event is no available in the commandbutton events list. However thanks for responding

  5. #5
    Registered User
    Join Date
    02-20-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Mousemove event

    @ JosephP



    Might work

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Mousemove event


  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Mousemove event

    Try this:-

    You need to play with the "X" and Y" variables and their poition to get the best results.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-20-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Mousemove event

    Quote Originally Posted by MickG View Post
    Try this:-

    You need to play with the "X" and Y" variables and their poition to get the best results.
    Please Login or Register  to view this content.
    thanks a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1