The only thing that I know you can do is make a bmp or ico file and use that as the image for the button. I have not seen it possible to change the color.
I know, I agree with you.
misscrf
It is never too late to become what you could have been ~ George Eliot
Re ability to change button color, that's one of my biggest complaints
Depending on how bad I want the color, I sometimes substitute a TEXT box for the command button, add a little flavor, use the Click event, stir for a while...
35+ years of 'progress' -- can't we all just go wire boards again?
and click on the contents. You will be able to find an Access Db that will include code that will change the back color of a button. It will also include code that will rotate the text on a button.
Plus, there are many more Dbs
hth
Jeff Bridgham
Purdue University
Graduate School
Data Analyst
I have been able to accomplish changing the button colour the following way.
First I create 2 different colour images of the button and place them ontop of each other. What we do now is alter the visability of the 2 button as the mouse moves over them, giving the effect of the button changing colour.
You also need to name the 2 images differently. In my example below they are called "cmdReset" and "cmdResetGrn". This is done in the properties --> other --> name field.
On the top button go into the property --> event section and create an [event procedure] for the "On Mouse Move" section. The code to add is:
Completely agree with label stuff, but why have a command button at all? Unattached labels expose some events that make them excellent "command buttons", without adding costly graphical elements.
Just alter the Special Effect property of the label to "Raised", then add the following in the MouseDown event:
I concur with your thoughts; however, there are some specific reasons one might want a transparent button:
1) a label control cannot gain focus
2) a button's click speed is different from a label's, i.e. 2 clicks at a rate that would be interpreted by a label as a double-click are interpreted by the button as 2 single clicks.
I think we talked about this in another thread a while back when I was designing a custom calendar form. I wanted the aesthetic flexibility of a label but needed the functionality of a command button and the label/transparent button trick was just the ticket.
But... for most cases I think your comments re: label vs. button are on the mark.
Eupher - you use both the click and double click event of the same control? Doesn't both event always fire when doubleclicked? If so - how do you separate them?
And, the mousedown event, could perhaps also be used to stuff the name/index of a control (label?) into a public variable for later retrieval?
Bit off, though, with regards to the colour of buttons
Another argument for using a command button, as opposed to the click events of a label, is that a couple of years down the road, when modifications need to be made to the db, it might not be the same person doing the work. Someone else coming in will be looking for a command button to carry out a command. Heck, it might even be you, and you could be looking for a command button! It's the same reason we all (well, most of us) name command buttons cmdMyCommand instead of simply MyCommand. Both work, but the former is easier for everyone to identify.
You're right, we're wandering a bit off-topic, but... ;-)
No, I don't use both the click and double-click events. But on a button the user may click much quicker and it's still interpreted as a single click; whereas with the label, the same rate of clicking would be interpreted as a double-click; and since there's no code on the double-click event, the second click just gets thrown away.
I guess I've never reflected about it, cause when toggling the special effect, there's no visual "button pressing" on the screen when the too hasty second click is issued - so there's no visual confirmation that anything is going to happen - one might perhaps say some consistency in the inconsistency?.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.