Print Page | Close Window

How to change the Button's Icon dynamically?

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=8522
Printed Date: 14 November 2025 at 1:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change the Button's Icon dynamically?
Posted By: Rebecca
Subject: How to change the Button's Icon dynamically?
Date Posted: 25 October 2007 at 2:18am
 
       I am using Xtreme ToolkitPro v11.2.0 for Visual Studio 2005.
 I have created a xtpControlButton with the Icon  in a  XTPRibbonGroup.
 
 
   CXTPRibbonGroup* pGroupScan = pTabFile->AddGroup(_T("File"));
   pGroupScan->Add(xtpControlButton,ID_FILE_SCAN);
 
How to change this button's Icon dynamically.  Thank you!



Replies:
Posted By: Oleg
Date Posted: 25 October 2007 at 4:27am

Hi,

Add update handler for ID_FILE_SCAN command and this code
 
CXTPControl* pButton =  CXTPControl::FromUI(pCmdUI);
 
 if (pButton )
 {
  pButton ->SetIconId(m_bNiceIcon ? ID_FILE_SCAN_NICDE : ID_FILE_SCAN);
 }


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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