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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background color of button 5

Status
Not open for further replies.

rcoutts

Technical User
Sep 5, 2001
60
0
0
US
Is it possible to change the background color of a button? when I select buttons, the Paint Bucket Tool gets greyed out. Also, the only color options I see under Format Properties are foreground color properties. I can change the background color of the form itself, but can't for the life of me figure out how to change the buttons.

Thanks!
Rich
 
Hi Rich,

I may be able to help but first which version of Access are you using, let me know.

Kenny
 
I felt stupid when I came across this VERY simple solution on another forum:
The "Button" is really just a "Rectangle" with some pre-set properties.
Instead of using the button tool on the toolbox, use the Rectangle tool. Set the "Special Effect" property to Raised. Set the Background property to the color you want. Set the OnClick event to run your sub/function.
It takes a bit more time, since there is not a wizard to help you through, but if you know how to set properties, you shouldn't have any problems.
 
In addition to RegionsRob's suggestion you can even set the Rectangle's Mouse Down event to change the special effect of the rectangle to SUNKEN and change it back to RAISED on the Mouse Down event. This will give the illusion that it has actually been clicked like a real button.

ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
Can this mouse down event be used in A '97? If so how do I perform this?
Thanks!
 
1. Go to the design view of the form.
2. Place a rectangle on the form.
3. Set the Special Effects property to "Raised"
4. Set Back Style property to "Normal" (This makes the rectangle solid)
5. You can also set the back color you desire at this point.
Now you have a command button.

6. On the Event tab of the rectangle's property box, go to the On Mouse Down event and put...

RectangleName.SpecialEffect = 2 (Gives the effect of the button going down)

7. In the On Mouse Up event put...

RectangleName.SpecialEffect = 1 (Gives the effect of the button coming back up)

8. Finally in the rectangel's Click event, put what ever procedure you want to occur.

ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
Works like a charm. Mr. Johnson, your help on this question has been so much more helpful than any other reply I have read in this forum! Thanks so much.
 
Is there any way to give the rectangle (button) a caption other than overlaying a text box?
 
I just realized I can just create a text label and create the button fx for the label, no need to use a rectangle. Thanks again!
 
Correct me if I am wrong but the only down side to this is the fact that you can't set the tab stop property for a label or rectangle. So users can't tab into the button and run it...... Robert L. Johnson III
robert.l.johnson.iii@citi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top