Print Page | Close Window

Change appearance of bitmap button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=18735
Printed Date: 17 November 2024 at 2:40am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change appearance of bitmap button
Posted By: VC++PROGRAMMER
Subject: Change appearance of bitmap button
Date Posted: 27 July 2011 at 9:34am
 
Our company has been using Xtreme ToolkitPro v11.2.2 for 5 yrs to provide skin for our VC++ SDI application. We created bitmap buttons using the class CXTButton as follows:

/*********************************************************/ 
DDX_Control(pDX, IDC_RECORD, m_btRecord);

// In ViewClass::OnCreate(LPCREATESTRUCT lpCreateStruct)
m_btRecord.SetBitmap( CSize(10,10), IDB_RECORD );//  IDB_RECORD is the bitmap resource
m_btRecord.SetBorderGap( 7 );
m_btRecord.SetXButtonStyle( m_btRecord.GetXButtonStyle() & ~BS_XT_SHOWFOCUS );
m_btRecord.SetTheme(xtThemeOffice2003);
/********************************************************/
Now we want to change the style of the button from flat to pushbutton style as follows:

                 Current CXTButton                                     Button style required
                   
 
It has to look like a normal cbutton with an image on it. We tried many methods but failed. Can anyone please please suggest a method to do this ?
 
Thanks.....Smile
 
 



Replies:
Posted By: Oleg
Date Posted: 28 July 2011 at 1:39am
Guess you need change m_btRecord.SetTheme(xtThemeOffice2003); to WinXP style. check Buttons sample for list of themes.

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


Posted By: VC++PROGRAMMER
Date Posted: 28 July 2011 at 9:33am
The issue was solved. Thanks for the quick reply...........Smile
 
For those with similar issue, i have given my code below.....
 
/***RESOURCE.RC ***/
   PUSHBUTTON      "",IDC_RECORD,58,43,15,14 ,WS_GROUP 
 
/*** VIEWCLASS.H ***/
 CXTButton    m_btRecord;
 
/*** VIEWCLASS.CPP ***/
/*** In ViewClass::::OnInitDialog( WPARAM, LPARAM ) ***/
 m_btRecord.SetTheme(xtThemeDefault);
 m_btRecord.SetXButtonStyle(BS_XT_WINXP_COMPAT);
 
/*** In ViewClass::OnCreate(LPCREATESTRUCT lpCreateStruct) ***/
 m_btRecord.SetBitmap( CSize(10,10), IDB_RECORD_NORMAL );
 m_btRecord.SetBorderGap( 6 );
 
Hope this would help someone who is new to VC++ like me.



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