Color on the button

J

Jose Perdigao

Good morning

mdb in MSAccess 2003



If enabled property on the button is false, is it possible to show for
example red color?

By default, if the button is not enabled, the color looks grey. I would like
to change the color.



Any Suggestions?

Thanks,

jose perdigao
 
B

BruceM

You could place a box or label over the top of the button, with its Visible
property set to True if the command button is not enabled, and False
otherwise.
 
J

Jose Perdigao

I was refering forecolor and not backcolor. Is it possible button enabled
set to false and show the forecolor?
Thanks
 
B

BruceM

It would have helped had you mentioned that. Setting Enabled to No gives
you what you see. I have done some experimenting, and have found that the
simplest method may be to make a label the same size and shape as the
command button, with the text (fore color) formatted as you would like it.
Rather than setting the command button's enabled property to false, set its
visible propety to false while setting the label's visible property to true,
and vice versa.
If you are looking for sunken text consistent with Enabled = False, I have
no idea.
 
M

Marshall Barton

Jose said:
mdb in MSAccess 2003

If enabled property on the button is false, is it possible to show for
example red color?

By default, if the button is not enabled, the color looks grey. I would like
to change the color.


The default gray is The Windows Standard that is used in
every windows program. If you do figure out something that
changes the appearance as you asked, then you will be
confusing your users by providing a non-standard appearance.

Note that if you also lock the control when you disable it,
the gray is not used and you can change the fore color.
 
J

Jose Perdigao

I know if I set controls enabled to false and lock yes, we can see the
forecolor, unfortunatelly, this procedure doesn't apply for the buttons,
that´s why I did this post. I can't see forecolor of the button if enabled
is false.
My question is, if there is way to show de forecolor of the button if the
enabled set to false.

Thanks,
josé perdigão
 
M

Marshall Barton

Sorry, I lost track of the fact that you were talking about
a command button and, of course, you're right that there is
no Locked property for command buttons.

As was mentioned earlier, using a Label control instead of a
button allows you to get the visual effect. However, labels
will not not accept the focus so they will not behave the
same as a button.

The closest I can come to achieving your desired effect
using a label control is to make the label's BackStyle
transparent and position it so that its caption is exactly
over the button's caption. Be sure to use the label's Click
event to conditionally set the focus to the button when the
button is enabled.

I want to reemphasise that going against the Windows User
Interface standard is not a good idea.
 

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

Similar Threads

Form View vs Datasheet View 6
Compact Current Dabase 5
command button color 2
Requery 5
Forms based a query 13
Control Tip Text 1
color coding values 1
Change captions in the buttons. 4

Top