Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I created a derived class where I use paint to change color of my button, But I don't know what must I write?

What I have tried:

I saw in internet but I don't find
Posted
Updated 17-Sep-19 23:31pm

1 solution

(I assume you are using MFC) There are many resources available (just use Google). Microsoft, for instance, provides the CMFCButton Class | Microsoft Docs[^]. Also, here at CodeProject you may find many articles on MFC button customization, see, for instance: CButtonST v3.9 (MFC Flat buttons)[^].
 
Share this answer
 
Comments
Member 14594285 18-Sep-19 6:16am    
thanks but I wanted an easier example because I'm a beginner..I wrote OnPaint in my derived class..and inside I want to write a code to change color of myu button
CPallini 18-Sep-19 6:48am    
You didn't Google, did you?
There is for instance this oldie-goldie, simpler implementation:
https://www.codeguru.com/cpp/controls/buttonctrl/advancedbuttons/article.php/c8395/Enhanced-Colored-Button.htm
Member 14594285 18-Sep-19 9:40am    
when I click in the link it gave me an error
Dave Kreskowiak 18-Sep-19 10:35am    
Every link he posted works.
Member 14594285 18-Sep-19 11:48am    
Sorry but I have problem with link

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900