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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change font colour of cmd buttons 3

Status
Not open for further replies.

perplexd

Programmer
May 9, 2002
154
0
0
US
This should be really easy, but I cannot seem to do it...

How do I change the font color of a cmd button?

You don't seriously have to take a screenshot of the text you want and use a graphical button do you? If this is the case then how can I trigger the button using shortcuts like Alt+A, Alt+B etc?
 
One option would be to use the Forms 2.0 Command Button. This button has a foreground color property. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
If you use the Forms 2.0 controls, doesn't that mean that the destination machine for the client must have Microsoft Office installed?

I could be wrong but I am sure I read that somewhere when investigating unicode controls within forms 2.0.
 
Not quite ChrisN - there is an issue in that the Forms 2.0 components (fm20.dll) is not redistributable.

The fm20.dll is included with the MS Office so that if the client has Office then they will have fm20.dll.

But, Office is not the only way to get the fm20.dll on the clients machine. The cheapest way (free) that I've found, is to download from the Microsoft Site the "ActiveX Control Pad", and then install the control pad - it also uses and will install the fm20.dll.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
You could solve the shortcut issue by setting the forms .keypreview property to 'true' and

-----------------------------------------------------------
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = vbAltMask Then
If KeyCode = Asc("A") Then Command1.SetFocus
End If
End Sub
----------------------------------------------------------- Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
fm20.dll should be already included with then following:

Any MS Office Product
W2k
XP
IE 3+

and maybe ME
*******************************************************
[sub]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!
 
Before using this control, try looking at Microsoft KB on the subject, particularly:
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.'
 
Sheridan SSCmd button can change font color but has only one line. It came with VB4 and still works in vb6
You can also make it with a very wide bevel like in a web page
 
Where do you get the Sheridan button from if you don't have VB4?

Sorry...I'm new, what is a bevel?
 
Here is an option. If you use an option button and set its style to graphical it will look like a command button but it will have a forecolor property. You will need to set its value to false in the click event to get it to behave like a command button as well. Just a thought. If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
Thanks to everyone for your help.

A special thanks foada, for the most straight-forward solution, which doesn't involve re-designing my form!!
 
To change the color of a command button is very simple. All u have to do is in the properties of the cmd button there should be a property called Forecolor and Backcolor. Forecolor is the color of the text put in the cmd button and backcolor is the background color. DONE!!!!!:)


vbabs
 
On a standard cmdbutton there is no ForeColor property...at least not in VB6
 
vbabs, the whole point of this thread is that VB's command button doesn't have a ForeColor property...
 

vbabs: The VB6 command button does not have a ForeColor property.
The one included with the fm20 does, and, generally, I have found that using this is one of the easiest, at no expense, better choices.
Until now, I have only run into an extremely small number of clients who have had problems with it (<1%) and those problems were corrected by getting the control off of one of their CDs or from the MS site. ][/b]][/i]][/u]*******************************************************
[sub]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!
 
foada - it may be just a thought, but its a star-qualify helpful thought. That is something that I will be able to take advantage of.

Thanks.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
As a follow-up. If you have other option buttons within the same container, they will get cleared when you press the Option Button. Even tho is graphical, it is still a radio button within that group, and interacts with the other RB's accordingly. So it may be a good idea to place your &quot;Option Button&quot; within its own frame, so it doesn't interact with other radio buttons.

It seems that you can also do this with a Graphical CheckBox, with downside being that you need to handle the second click event when you reset the checkbox back to vbUnchecked. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top