Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Changing Text Color on a command Button

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

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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.

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


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 100 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

670 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