How to change push button color in Visual C++ 6.0
Posted this question on C++ general but it may better fit under
this posting:
I was able to change my dialog box background color in Visual C++
6.0 under InitInstance() with SetDialogBkColor(). That function
set the text and background color but excluded the push buttons
include on the dialog window.
Tried submitting a question to C++ Pro but never got a response.
Anyone know how to change push button background and text colors
on a dialog window?
Thanks.
[505 byte] By [
Joseph] at [2007-11-10 12:51:59]

# 1 Re: How to change push button color in Visual C++ 6.0
Hello,
I found this at the MSDN site (http://msdn.microsoft.com/library). This
was included in an FAQ by Jeff Prosise.
>How do I change the background color of a button?
>
>Note: the method in "How do I change the background color of a control?"
will not work for buttons!
>
>If you want to change the color of a dialog button, you have to use an owner-draw
button. (You can use bitmap buttons.) Changing the color through OnCtlColor()
will not work for buttons. The following Knowledge Base
>articles may be of help to you: Q32685, "Using the WM_CTLCOLOR Message,"
and Q64328, "SAMPLE: Owner-Draw: 3-D Push Button Made from Bitmaps with Text."
This article explains sample code for a owner-draw button.
>
> Ramesh (NetQuest), MSMFC, 8/3/95
So it looks like you have to create a owner draw button. Sorry I dont know
more details, but hope this helps.
-Johnny
"Joseph" <karpinskij@nimo.com> wrote:
>
>Posted this question on C++ general but it may better fit under
>this posting:
>
>I was able to change my dialog box background color in Visual C++
>6.0 under InitInstance() with SetDialogBkColor(). That function
>set the text and background color but excluded the push buttons
>include on the dialog window.
>Tried submitting a question to C++ Pro but never got a response.
>Anyone know how to change push button background and text colors
>on a dialog window?
>
>Thanks.
>
Johnny at 2007-11-11 20:40:28 >
