tags:

views:

19

answers:

2

Hi..... everybody,

Am doing a calculator programme in vc++/MFC dialog application. Thier, i want to change the foreground and background colour of a push button in dialog. I have no idea, how to change. Please suggests me with relevent code or example if any body have idea.

basu_sagar

+1  A: 

There's no easy way to do this in a classical VC/MFC application, button colours are always system-defined. You either have to use a custom control, or create an owner-draw button. Handling WM_CTLCOLOR and returning a different brush doesn't work for buttons.

Edit:

This is an example replacement button control someone has built to solve this problem by encapsulating the owner-draw code into a class.

Please note: with a 0% accept rate, you won't find many people willing to spend time answering your questions.

Bob Moore
A: 

This link has the information you are looking for: CWnd::OnCtlColor

anand.arumug