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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.


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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

710 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