Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Buttons 1

Status
Not open for further replies.

TadyB

Programmer
May 21, 2004
42
0
0
US
Hello.

Is it possible to change the background color of a button. I do not see the option in the properties box...just fore color?
 
As you noticed, you can't change the background color of a command button from its properties. One thing you could do is make a label and have it raised - change Special Effect in the property of the label to Raised. It should then appear as a command button.



HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Thanks HTH, but that didn't quite work the way I wanted. When you try to "click" on the button, it places the cursor inside which is not quite what I'm looking for. I'll just stick with grey...it's not that bad...I was just curious if I was missing a property that could do it.

I appreciate your help.

Thanks,
Stacey
 
I am referring to a LABEL, not a text box. I have done it many times and it works. Change the effect to raised, indicate the caption and change the background color.


Maurie

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Oops...sorry I did read that wrong!!

Thanks so much...it's a great idea!


Stacey
 
If you want to emulate the full look of a button with your label, use the MouseDown and MouseUp events to change the effect from Raised to Sunken and back.

HTH
Lightning
 
TadyB---
I get around it by using labels and the following code found on UtterAccess.com, posted by Grove:

I set the Special Effect property to raised. Then with the MouseDown and MouseUp events I add the following Code:
------------------------------------------------------------
Private Sub Label8_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label8.SpecialEffect = 2
Label8.BackStyle = 0
End Sub
------------------------------------------------------------
Private Sub Label8_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label8.SpecialEffect = 1
Label8.BackStyle = 1
End Sub
--------------------------------------------------------------------------------

This way I can color it any way I want.

-Dave-
 
Dave

This is great, and worthy of a star, but not just yet...how to I link the label to a control source?

Jim DeGeorge [wavey]
 
Hi Jim,

Didn't get a chance to look at my email until today (1/19/05). I have been tied up with some other things. Won't be able to reply constructively until the middle of Feb. '05. Hopefully, someone else can help follow thru with your delimma.

Good Luck!
Maurie

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
Maurie

That's okay. Don't sweat it. This is a "nice-to-have" feature any way so I'm not going to kill myself over it either.

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top