Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC
  New Posts New Posts RSS Feed - Add bitmap on next button of property sheet wizrad
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedAdd bitmap on next button of property sheet wizrad

 Post Reply Post Reply
Author
Message
aarti View Drop Down
Newbie
Newbie
Avatar

Joined: 10 July 2009
Location: India
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote aarti Quote  Post ReplyReply Direct Link To This Post Topic: Add bitmap on next button of property sheet wizrad
    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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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.141 seconds.