Changing Text Color on a command Button

Posted on 1999-01-07
Last Modified: 2012-05-04
Is there a way to change the forecolor of a command button text?
Question by:texasboy
LVL 12

Expert Comment

ID: 1454722
.ForeColor ?

LVL 12

Expert Comment

ID: 1454723
Hmmm, son-of-a-gun, spoke too soon.

Just checked, the Help says that there should be a .ForeColor property but it doesn't show on the Properties list and generates an error when set programmatically. Looked under the fonts and I can set Bold, Italic, underlined, but no color.

There is a MaskColor and such, but that doesn't effect the text color. Looks like you'ld have to use an API call (if there is one).

Reject me!



Expert Comment

ID: 1454724
Could you use an SSCommand button instead, or use the other Microsoft one (part of Microsoft Forms Controls 2 - or something like that) - I think you should be able to set forecolor on both of those, though each has several different properties. Just a suggestion.

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why


Author Comment

ID: 1454725
Doesn't answer my question.

Expert Comment

ID: 1454726
You have to Change the Style property of the command to Graphical and then the ForeColor property will be effective

Author Comment

ID: 1454727
that only changes the back color.

Accepted Solution

halsch earned 50 total points
ID: 1454728
Hey Tex...
Using "Paint", Create a BMP file the same size as the Cmd button, with the background color the same as the Cmd button BackColor property and type your text(MS San Serif 8 pt) in the desired color. Save the BMP.
Set the "Picture" property of the Cmd button to point to the BMP file you just created.

It's not fancy, but it does work.

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question