UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Command Button Hover Color, Office 2010    
 
   
MVarner
post Mar 21 2012, 04:01 PM
Post#1



Posts: 17
Joined: 15-May 10



Is it possible to change the hover color of a command button in Access 2010 using VBA or a Macro. I can't seem to fine a property for that anywhere. If so can someone tell me how?
arshall
Go to the top of the page
 
RJD
post Mar 21 2012, 06:44 PM
Post#2


UtterAccess VIP
Posts: 10,081
Joined: 25-October 10
From: Gulf South USA


Hi Marshall: Here's one way to do it (I'm sure there must be others). In this demo the command button is retained, but made transparent. A label is slipped underneath and sent to the back. Then the Mouse Move event of the command button is used to change the Back Color of the label to red (just an optional color here as an example). The detail section Mouse Move event is used to change color label back to gray.
Is I say, no doubt there are other ways, but I like to keep the command button and do the color with the label underneath.
HTH
Joe
Attached File(s)
Attached File  CommandButtonHoverColor.zip ( 13.55K )Number of downloads: 71
 
Go to the top of the page
 
RJD
post Mar 21 2012, 06:58 PM
Post#3


UtterAccess VIP
Posts: 10,081
Joined: 25-October 10
From: Gulf South USA


Hi again: Here's another demo - it adds a technique of just using the label, without the command button over the top. You have to adjust the text spacing, visual format, etc. to do this, but accomplishes essentially the same thing with one object.
oe
Attached File(s)
Attached File  CommandButtonHoverColor2.zip ( 20.81K )Number of downloads: 74
 
Go to the top of the page
 
missinglinq
post Mar 21 2012, 08:18 PM
Post#4



Posts: 4,637
Joined: 11-November 02



And just so that you know, Marshall, the only really practical way to do this is using some variation on those that Joe has given you. The BackColor of Command Buttons is one of those things that has to be set through Windows, and effects all Command Buttons in all Windows-compliant apps on the machine. Only the Fore (text) Color of a Button can be manipulated using VBA.
Linq ;0)>
Go to the top of the page
 
theDBguy
post Mar 21 2012, 08:31 PM
Post#5


Access Wiki and Forums Moderator
Posts: 76,381
Joined: 19-June 07
From: SunnySandyEggo


Hi Marshall,
ardon me for jumping in... but for Acc2010, you can use the "Hover Color" property to change the color of the button when the mouse is placed on top of the button and use the "Pressed Color" property to change the color of the button when the user clicks on it.
Just my 2 cents... 2cents.gif
Go to the top of the page
 
RJD
post Mar 21 2012, 08:55 PM
Post#6


UtterAccess VIP
Posts: 10,081
Joined: 25-October 10
From: Gulf South USA


Very good call DBguy. I almost always use A2007 and hadn't tested with A2010 (on another machine awaiting SP2). But you are certainly correct - with A2010 (just looked at) the "Hover" color features have been added. Much better solution if app is to be run exclusively on A2010 - and I should have caught that he was using A2010.
egards,
Joe
Go to the top of the page
 
missinglinq
post Mar 21 2012, 09:12 PM
Post#7



Posts: 4,637
Joined: 11-November 02



Well hush my mouth, as we say down South! What will the Access Gnomes think of next? Maybe fixing some of the bugs that have been around for over a decade? Oh, no, that would make too much sense!
Linq
Go to the top of the page
 
MVarner
post Mar 22 2012, 03:20 PM
Post#8



Posts: 17
Joined: 15-May 10



Thanks for all the great responses. I have decided which option to use just yet but it always nice to have options.
Marshall
Go to the top of the page
 
theDBguy
post Mar 22 2012, 03:46 PM
Post#9


Access Wiki and Forums Moderator
Posts: 76,381
Joined: 19-June 07
From: SunnySandyEggo


Hi Marshall,
Joe, Linq, and I are all happy to help. Good luck with your project.
Go to the top of the page
 
Pigeon Pie
post Aug 13 2019, 09:37 PM
Post#10



Posts: 1
Joined: 13-August 19



me.[CONTROL NAME].properties("hovercolor") = rgb(100,200,100)
Go to the top of the page
 
theDBguy
post Aug 13 2019, 10:04 PM
Post#11


Access Wiki and Forums Moderator
Posts: 76,381
Joined: 19-June 07
From: SunnySandyEggo


Hi. Welcome to UA! welcome2UA.gif

Just FYI, you are posting on a very old thread (over 7 years).

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th October 2019 - 07:24 PM