Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Command Button Font Color?

Status
Not open for further replies.

DavidMayo

MIS
Joined
Sep 22, 2002
Messages
2
Location
US
Hey y'all,

I tried running a search for this and found nothing. Does anyone know how to change the font color for command buttons? I've tried and tried and can't find a way...

Thanks!
David
 
Right-click on the command button and click on CommandButton Object then choose edit. From here, the text in your button can be selected. Highlight the text and from the Properties window, click on the arrow on "Forecolor". This may just be one of the ways you can change the font color. Ciao! :>
 
Errmm ...

Check out thread222-260981 by CajunCenturion

Befrore using Forms controls, check out

especially the bit at the bottom recommending care in use of these controls except in VBA Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Thank you so much for the quick response. I'm actually using VB for pretty much the first time, so I really appreciate the help.
 
Another way would be to create a Bitmap a little smaller than the command button with the desired text and forecolor.

Then assign the command button's picture property to this Bmp, and it's Style property to 1-Graphic. And delete any text in it's Caption property.

Then you will have exactly what you want.

You should however, set the background color of the Bmp to one that you want, such as grey, and also the MaskColor property to the same color(not a systems color!) and set the UseMaskColor property to True. Then the back color of the Bmp will be the same as the Back color of the button, and not different if the user changes system colors. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Just another option. You can use an option button and set its style property to graphical and it will look like a command button, then set the click event to set the value to false like this

Private Sub Option1_Click()
Option1.Value = False
'Rest of code
End Sub

Then you can set the forecolor property to change the font color. Hope this helps. If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 

Another option to what foada mentioned would be to do the same but with a check box....In it's click event you would do this:

Private Sub Check1_Click(Index As Integer)
Static bGetOut As Boolean

If bGetOut Then Exit Sub
bGetOut = True
Check1(Index).Value = 0
bGetOut = False

End Sub

Also in foada's example, using the option button, you would need to do this. The only difference between the two is the fact that if you have more than one option button on the same conaitner, they will act like option buttons: One will always be down. This may or may not be desired.
If not, then do the same as the above example with the CheckBox.

The checkbox example seems to react a little smoother for some reason. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top