Vsn said:
Hi all,
Could someone tell me if and how i can change the button color from its
default grey?
Buttons always pick up the Windows system color so buttons in Access will
have whatever color your Windows color scheme has defined for Windows
buttons. You can use an image of a solid colored rectangle to mimic a
different colored background.
Alternatively, you can use the Click event of a label instead of using a
button. It's even possible to use the MouseDown and MouseUp events to
change the label's special effect to "sunken" and "raised" so it will behave
like a button visually. I did that a few times mostly as an exercise but
would no longer go to the trouble. It is common enough on the web and other
environments to click on things that look like buttons to perform actions
without expecting the button to actually move in and out that I don't think
the lack of movement will confuse many users.
My biggest reason to not use labels as buttons is that they can't receive
focus and in many cases that is a problem. That also means you can't
operate them from the keyboard.
Access has a nice solution to that issue. You can create a button that is
transparent and place it on top of the colored label. It will look like the
label is the thing being clicked on when it is actually the transparent
button. The transparent button can receive focus thus allowing it to be
operated via the keyboard, but there it does not unfortunately give the
standard highlighting to let you know that it has focus.