Print Page | Close Window

Add bitmap on next button of property sheet wizrad

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Visual C++ MFC
Forum Description: Topics related to Codejock Visual C++ MFC products
URL: http://forum.codejock.com/forum_posts.asp?TID=14716
Printed Date: 12 December 2024 at 9:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add bitmap on next button of property sheet wizrad
Posted By: aarti
Subject: Add bitmap on next button of property sheet wizrad
Date Posted: 10 July 2009 at 5:55am
Hello All,
I am working on Property sheet wizard based application .My problem is that i have to add bitmap to Next ,Back,Cancel buttons of Property sheet.I used CBitmapButton Class and uses follwing approach to add bitmap to buttons.

CButton *btnNext,*btnCancel,*btnHelp;
CBitmaputton btnBmpNext,btnBmpCancel,btnBmpNext;


// Get a handle to each of the existing buttons
btnCancel = reinterpret_cast<CButton *>(GetDlgItem(IDCANCEL));
btnNext = reinterpret_cast<CButton *>(GetDlgItem(ID_WIZNEXT));
btnHelp = reinterpret_cast<CButton *>(GetDlgItem(IDHELP));



LONG GWLNext = GetWindowLong(btnNext->m_hWnd, GWL_STYLE);
SetWindowLong(btnNext->m_hWnd, GWL_STYLE, GWLNext | BS_OWNERDRAW);
BOOL b=btnBmpNext.SubclassDlgItem(ID_WIZNEXT, this);
btnBmpNext.LoadBitmaps(IDB_SCAN_NORMAL, IDB_SCAN_CLICK,
IDB_SCAN_HOT, 0);




LONG GWLCancel = GetWindowLong(btnCancel->m_hWnd, GWL_STYLE);
SetWindowLong(btnCancel->m_hWnd, GWL_STYLE, GWLCancel | BS_OWNERDRAW);
btnBmpCancel.SubclassDlgItem(IDCANCEL, this);
btnBmpCancel.LoadBitmaps(IDB_EXIT2, IDB_EXIT_CLICKED,
IDB_EXIT_FOCUS, 0);

LONG GWLHelp = GetWindowLong(btnHelp->m_hWnd, GWL_STYLE);
SetWindowLong(btnHelp->m_hWnd, GWL_STYLE, GWLHelp | BS_OWNERDRAW);
btnBmpHelp.SubclassDlgItem(IDHELP, this);
btnBmpNext.LoadBitmaps(IDB_SCAN_NORMAL, IDB_SCAN_CLICK,
IDB_SCAN_HOT, 0);
it successfully add bimap to next and cancel button but when i navigate to next page by clicking next button bitmap on next page does not remain on Next button and when i clicked back button the bitmap applied on first page also got vanishes.

How to handle these things as i am newto wizard type applications and doesnt know how to apply bitmap for all pages of propertysheet.

waiting for reply soon as i am struck in my project.

Thanks



Replies:
Posted By: znakeeye
Date Posted: 10 July 2009 at 10:59am

I believe you need to do this in CMyPropertyPage::OnSetActive() or perhaps CMyPropertyPage::OnInitDialog() is enough?



-------------
PokerMemento - http://www.pokermemento.com/



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