:confused:
if it is possible could someone tell me how to change the color of the text on a command button?
Printable View
:confused:
if it is possible could someone tell me how to change the color of the text on a command button?
Set the Style to Graphical in the Propertys window... Then set its backcolor to whatever you want.
thanks
That'll only change the colour of the button itself - it's not actually possible to change the text colour.
The only way would be to make/download an activeX control which has this allowed...
You can use a checkbox instead
set its style=graphical
Code:Option Explicit
Private Sub Check1_Click()
Check1.Value = Unchecked
'put your normal command code here
End Sub
i see...
Ohh my bad i thought you said Backcolor not forecolor.
use the module i atached andhere is how you would use it
SetButton Command1.hWnd, vbWhite
That doesn't actually seem to do anything...
ya it does......just set the style to graphical and then the backcolor to black or what ever and then use this in the form load setbutton yourcommandname.hwnd, yourforecolor
add the moduale and this form that i attached and try it
You forgot to mention the .Style = Graphical bit...
This is what I have been using lately. I think the module is something Serge had post that I modified.
Also if you have Microsoft Office installed, then you could check out "Microsoft Forms 2.0 Form" in components. It has a command button with a ForeColor property. If you don't see it in the components list, check the Designer tab and see if it is listed there.
ya that will work 2
Overlay a textbox over the top of a command button
1. Create a textbox with borderstyle = none, backcolor = &H8000000A&
2. Set the forecolor to whatever you want and the text property to whatever you want the button's caption to be.
3. Under the [format] menu [order] send the command button to the back and Bring the textbox to the front and position the textbox over the command button.
then under the text1_click event simply call the command button click event.
eg.
Private Sub Text1_Click()
Me.Command1.SetFocus
Call Command1_Click
End Sub
As forms 2.0 is not redistributable with your application, you could also use the SS Sheridan Command Button as it has a forecolor property.
Ships with Vb
It is stored on your Install disk.
Look under Vb/Controls/THREED32.ocx
Copy that file into Windows\System
then when you open a new project you will see Sheridan Controls
I would like use a label to make it "like" a command button:cool:
are you talking about 3d buttons or flat buttons dongaman?
yes
yes,no, maybe, perhaps not...
Right,it is just a test.
Yuk!Quote:
Originally posted by Nucleus
Overlay a textbox over the top of a command button
1. Create a textbox with borderstyle = none, backcolor = &H8000000A&
2. Set the forecolor to whatever you want and the text property to whatever you want the button's caption to be.
3. Under the [format] menu [order] send the command button to the back and Bring the textbox to the front and position the textbox over the command button.
then under the text1_click event simply call the command button click event.
eg.
Private Sub Text1_Click()
Me.Command1.SetFocus
Call Command1_Click
End Sub
That's messy.
Well it works without any extra dependencies, what would you recommend to avoid using extra dependencies soi-disant Guru?
Quote:
Originally posted by Nucleus
Well it works without any extra dependencies, what would you recommend to avoid using extra dependencies soi-disant Guru?
Quote:
Originally posted by Guru earlier in this thread (not that anybody bothered to read it!)
You can use a checkbox instead
set its style=graphical
Code:Option Explicit
Private Sub Check1_Click()
Check1.Value = Unchecked
'put your normal command code here
End Sub
*cough* checkbox doesn't look and feel as nice as a proper command button *cough*.;)
use this: