Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Change appearance of bitmap button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change appearance of bitmap button

 Post Reply Post Reply
Author
Message
VC++PROGRAMMER View Drop Down
Newbie
Newbie
Avatar

Joined: 29 June 2011
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote VC++PROGRAMMER Quote  Post ReplyReply Direct Link To This Post Topic: Change appearance of bitmap button
    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
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
VC++PROGRAMMER View Drop Down
Newbie
Newbie
Avatar

Joined: 29 June 2011
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote VC++PROGRAMMER Quote  Post ReplyReply Direct Link To This Post 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.
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.156 seconds.