Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC VC++
how to change color of button in vc++ mfc for vs2008
 
Sorry Its not working please give details please
Your code is not working please give me details please please,Its urget
Posted 31-Jan-13 3:51am
debarunb1.1K
Edited 12-Feb-13 21:13pm
v3
Comments
Maximilien at 31-Jan-13 9:26am
   
What have you tried so far ? what did your google searches returned ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

1. Place Button with Resource Editor
2. Add Variable for Button (for example m_StopButton ) with Wizard
3. Rename
   CButton  m_StopButtonto;
to
   CMFCButton  m_StopButton;
4. Change some visible features
 
// Set the background color for the button text.
  m_StopButton.SetFaceColor(RGB(255,0,0),true);
  m_StopButton.SetTextColor(RGB(0,0,255));
  // Set the tooltip of the button.
  m_StopButton.SetTooltip(_T("This is my Stop Button!"));
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

It is also needed to include the header afxbutton.h, i.e. #include "afxbutton.h"
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,205
1 DamithSL 5,114
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,747
4 Kornfeld Eliyahu Peter 4,474


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 17 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100