Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151

    Question Resetting Command Button Colour

    Hi all

    This is a bit of an odd one.

    I have a main menu form that contains a number of command buttons. The command buttons have Back Color (Accent 5, Darker 25%) and a Hover Color (Accent 5, Darker 50%). Works well and looks good.

    When a button is pressed another form is loaded. The main menu form remains open underneath the newly opened form.

    The problem is that when the newly opened form is closed, the button that loaded it has retained the Hover Color, and doesn't return to the normal Back Color view unless the mouse is again moved over the button.

    Is there some way that I can "refresh" the button after the button press, so that it has the original appearance when the newly opened form is closed?

    Thank you in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I cannot replicate this behavior in Access 2010.

    If I move second form, I can see button color is still for Hover but when second form closes, button returns to BackColor.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    it has retained the Hover Color, and doesn't return to the normal Back Color view unless the mouse is again moved over the button.
    When you mouse over isn't that when you get the Hover colour? So hovering over should not "return to the normal Back Color"?

    https://learn.microsoft.com/en-us/of...ton.hovercolor
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi June
    That is exactly the behaviour I expected, but it isn't so.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Have you tried running on different computer?

    You could provide your db for review.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Quote Originally Posted by Micron View Post
    When you mouse over isn't that when you get the Hover colour? So hovering over should not "return to the normal Back Color"?

    https://learn.microsoft.com/en-us/of...ton.hovercolor
    Hi Micron

    The colour does change when I hover over and click to open the new form. If I move the new form so that I can see the original form, I can see that the button colour has remained the hover colour after it has been clicked.

    I would have thought that closing the new form would have "reset" the original form and that the hover colour was removed and replaced with the back colour, as June7 is seeing.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    All I can think of is that you have 2 properties using the same colour. Did you look at the link I provided? I posted that because it also lists several options that are not in the property sheet for a command button.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Quote Originally Posted by sheusz View Post
    Hi June
    That is exactly the behaviour I expected, but it isn't so.
    Hi June

    I've tried on another computer with the same result. Sharing the DB could be problematic. It's HUGE. I'll try replicating the issue on a smaller DB.

  9. #9
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi Micron

    Thanks for your reply. Yes, I did read the link, but that doesn't seem to offer a solution. I'll check all the properties and see what I can find.

  10. #10
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Have you tried replacing the control to rule out any type of corruption?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  11. #11
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Yes I have. Still the same. I've also tried various iterations but still get the same result.

  12. #12
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    a copy of the db with most of objects removed would suffice, no?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Quote Originally Posted by Micron View Post
    a copy of the db with most of objects removed would suffice, no?
    Hi all

    Thanks for your suggestions and input.
    I've created and attached a small DB that demonstrates the problem.

    I've also included a link to video that shows the behaviour in the actual DB. (hope this is OK)

    https://multicamsystems-my.sharepoin...mc5kg?e=A2REju


    HoverTest.zip

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    By any chance that for this db you unselected "use Windows themed control" option when you built the main form? Or you changed all your button styles using Quick Styles on the format tab of the ribbon? I'm thinking that the button style you're using, or not using themed controls - doesn't play well with hover property.

    EDIT - apparently that's not it (if I understand the problem you're having) because I added what I'd call a button of my default themed style. When I opened your form with it, its hover colour remained, even when I tabbed off of it. Midnight here, so that's it for now.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi Micron

    I've never used Windows themed control or Quick Styles (they didn't exist when I originally built the DB).

    Interestingly, when you change the Back Color or Hover Color, the Use Theme property changes to Yes. Changing it back to No mucks up the colours, but doesn't resolve the issue.

    I'm testing all this on this HoverTest DB I uploaded to preclude any possible legacy issues with my working DB.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 21
    Last Post: 02-08-2019, 11:18 AM
  2. Resetting Autonumber Field on command
    By Paul H in forum Programming
    Replies: 2
    Last Post: 04-17-2014, 12:43 PM
  3. Replies: 6
    Last Post: 11-14-2013, 07:37 AM
  4. Replies: 3
    Last Post: 08-04-2013, 07:11 AM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums