Print Page | Close Window

CXTButton SetColorFace

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9833
Printed Date: 23 April 2024 at 2:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTButton SetColorFace
Posted By: DoubleHammer
Subject: CXTButton SetColorFace
Date 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.



Replies:
Posted By: rmercer
Date 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);



Posted By: DoubleHammer
Date Posted: 10 March 2008 at 3:44pm

Hi

Thanks for that. It has pointed me in the right direction.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net