Solved

Changing Text Color on a command Button

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

Expert Comment

by:mark2150
ID: 1454722
.ForeColor ?


0
 
LVL 12

Expert Comment

by:mark2150
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!

M

0
 
LVL 1

Expert Comment

by:dgb001
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.
Dave

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:texasboy
ID: 1454725
Doesn't answer my question.
0
 

Expert Comment

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

Author Comment

by:texasboy
ID: 1454727
that only changes the back color.
0
 

Accepted Solution

by:
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.
Hal
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now