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

Color of Command Button 2

Status
Not open for further replies.

Digsys

Technical User
Jun 27, 2002
170
AU
I am trying to change the background color of a command button. I cant see anything relevent in the properties list. Any suggestions?
Thanks
 
The only way I have found to do it is - make your Command Button transparent and place it "ON TOP" of a label of the colour you want

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
There are no properties for the background color of a command button. But, we can fool it into thinking it is more beautiful than just battleship grey.

Set the transparent property of the command button to Yes. Set the Caption property of the command button to an empty string or nothing.

Create a rectangle with the rectangle tool. Change the background color of the rectangle to whatever color you would like. Make the rectangle the same size as the command button. Create a Label with the Label tool. Type in the Caption that you would like the Command Button to appear to have(i.e. Save Record, Delete, Print, etc.)

Now we have three objects on the form and want to stack them rectangle on the bottom, Label centered over the rectangle, and command button on top.

You now have a colored Command button. You can change the color of the button and the caption by changing the backcolor of the rectangle box and the caption property of Label. Code for the Command button can still be placed in the Event Procedures of the Command button. You should also make sure that the Tab Stop for the Rectangle Box and Label are set to No.

Who said you couldn't have a colored command button. Not me.

Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top