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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.