Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTButton SetColorFace
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTButton SetColorFace

 Post Reply Post Reply
Author
Message
DoubleHammer View Drop Down
Newbie
Newbie
Avatar

Joined: 07 March 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote DoubleHammer Quote  Post ReplyReply Direct Link To This Post Topic: CXTButton SetColorFace
    Posted: 09 March 2008 at 5:29pm
Hi,
 
I have a CFormView view with a couple of buttons on it which are subclassed as CXTButton types. I want to be able to set their face colors to different colors when the form is initialy updated and also during run time. When I set the color, all the buttons assume the same color as the button which had the last SetColorFace function called on it.
 
Can I do what I want to do with the CXTButton type?
 
 
Thanks in advance.
Back to Top
rmercer View Drop Down
Groupie
Groupie


Joined: 22 February 2006
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmercer Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 10:33am

Originally posted by DoubleHammer DoubleHammer wrote:

Hi,

 
I have a CFormView view with a couple of buttons on it which are subclassed as CXTButton types. I want to be able to set their face colors to different colors when the form is initialy updated and also during run time. When I set the color, all the buttons assume the same color as the button which had the last SetColorFace function called on it.
 
Can I do what I want to do with the CXTButton type?
 
 
Thanks in advance.
If I recall correctly, the buttons share the application theme unless you've specifically overridden it using SetTheme since the colors are defined in the theme.  So to have different face colors you have to actually create and assign a new dedicated theme to each button...  ie:
 

m_btnContinue.SetTheme(new CXTButtonThemeOffice2003);

((CXTButtonThemeOfficeXP*)m_btnContinue.GetTheme())->UseWordTheme(FALSE);

m_btnContinue.SetXButtonStyle(BS_XT_SHOWFOCUS);

m_btnContinue.SetIcon(CSize(32, 32), IDI_YOURICON);

m_btnContinue.SetColorFace(m_crYourColor);

Back to Top
DoubleHammer View Drop Down
Newbie
Newbie
Avatar

Joined: 07 March 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote DoubleHammer Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 3:44pm

Hi

Thanks for that. It has pointed me in the right direction.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.