command button color

V

Vsn

Hi all,

Could someone tell me if and how i can change the button color from its
default grey?

Thx,
Ludovic
 
R

Rick Brandt

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.
 
A

Al Campagna

Vsn,
That depends on your version of Access.
2007 has button "transparency" which... with colors placed
behind... appear to be colored.
Also, Stephen Lebans' excellent site has had a widely use button
coloring system. http://www.lebans.com/cmdbutton.htm for older
versions, and probably 2007 also.

A Google search, or a Google Groups search, should yield many
"hits" on this subject.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top