PDA

Click to See Complete Forum and Search --> : Command Button Colour


nmretd
Nov 15th, 1999, 11:38 AM
Quick question.

Is it possible to change the colour of the Font on a command button. If so, how can I do it ?

Yonatan
Nov 15th, 1999, 11:48 AM
You can do this the easy way or the fun way! :)

The easy way:
Fake a CommandButton like this:
1. Create a CheckBox.
2. Set it's Style property to 1 (Graphical).
3. Put this code in it:

Private Sub Check1_Click()
If Check1.Value = vbUnchecked Then Exit Sub
If Check1.Value = vbChecked Then Check1.Value = vbUnchecked
Call MsgBox("Put CommandButton code here...")

End Sub

The hard (fun) way to do this is to set the CommandButton's style to 1 (Graphical), subclass the form, catch WM_DRAWITEM messages and manually draw the button text. Tell me if you need an example...

------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69