+ Reply to Thread
Results 1 to 5 of 5

Avoid command button flickering on MouseMove event

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Avoid command button flickering on MouseMove event

    Hey! Does anyone have any suggestions or clever tips to prevent flickering of command buttons on mousemove events? I have a row of 12 buttons on a userform that I'm trying to make a bit more interactive. Yesterday I set all of these buttons to change backstyle to opaque and forecolor to a preset color on MouseMove. I coded this for all 12 buttons. To change the colors back, I've coded backstyle to transparent and forecolor to black for each button on the Userform mousemove, a few frame mousemoves, and some label and textbox mousemoves. This worked, but I noticed the buttons flicker on occasion...a little too much for my liking. I've determined this is most likely because I have so many mousemove events going on. Fortunately, or unfortunately considering I spent half a day coding all of this, I accidentally saved over all of my work I did yesterday so all of this coding was lost. Before I start re-coding all of this, I'd like to get a little input on the do's and don't of using mousemove events. Would adding IF statements in front of my code prevent flickering? I'm assuming it's best to use the mousemove event as minimal as possible here? Any guidance/input is welcome as I'm not too knowledgeable about this particular event.

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

    Re: Avoid command button flickering on MouseMove event

    that sounds like a lot of work for no real benefit to me
    Josie

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

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: Avoid command button flickering on MouseMove event

    True, there is no actual benefit to doing this, it's merely an aesthetics thing. There's something about plain gray buttons that just annoys the creative side of me. Plus, I don't feel like working on my spreadsheets today Don't you ever do things just because you can?

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

    Re: Avoid command button flickering on MouseMove event

    all the time but not for real projects and not merely to add flashy cosmetic details. I'm far more concerned with projects working than adding unnecessary effects to them ;-)

    anyway-did your code check the current back- and fore-colors before reapplying them?

  5. #5
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: Avoid command button flickering on MouseMove event

    Well, the core of my project works flawlessly, and I'm motivated, so it's time to add a little style

    ...but no, I did not have my code check the current back & fore colors. I'm contemplating doing so, but wanted to get someone's input on whether or not they think it would have any positive effect before moving forward. Being that you've asked the question, I'm going to do it on a copy and see how it works

+ 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