How to SubClass a checkbox on a DialogBar
-
hi, all a problem trouble me for a long time. X| and i have been looking for the answer for a long time. but i still can't solve it,i hope somebody can give me a little suggestion. thanks in advance. my dev platform: MFC 7 & Windows Server 2003 my question: i want to subclass my checkbox on a dialogbar, and load my bitmap to the checkbox's face. all of my checkbox were set to push like style here owner-draw mode was set to true . in headfile MyDialogBar.h ====================================================
CBitmapButton m_btnCheck; BOOL InitButtons();
==================================================== in cppfile MyDialogBar.cpp ====================================================BOOL CMyDialogBar::InitButtons() { m_btnCheck.SubclassDlgItem(IDC_TOOLBTN_SELECT, this); m_btnCheck.LoadBitmaps(IDB_BITMAP_ICON_SELECT); }
==================================================== in headfile MainFrm.h ====================================================CMyDialogBar m_myDlgbar;
==================================================== in cppfile MainFrm.cpp ====================================================int CMainFrm::OnCreate(...) { if(!m_myDlgbar.Create(...)) { TRACE0("sorry >_< "); return -1; }; m_myDlgbar.InitButtons(); }
==================================================== Notes:**IDB_BITMAP_ICON_SELECT**
is a ID of bitmap resource file created by resource editor , i want this bitmap loaded on the checkbox button.**IDC_TOOLBTN_SELECT**
is the ID of the CheckBox the checkbox can works fine, but i just cannot put my bitmap on it. why?? :confused::confused: i used to subclass my checkbox and load a bitmap on its face for many times in common dialog application , there is no problems. why i use it in dialogbar, it doesn't work, and no error occured , the checkbox button works fine.:confused: i found something seems to be useful on MS KB, i rewrite my code , and it still does not work, :doh: http://support.microsoft.com/kb/185672 anybody here met this problems before? can you get me out of this swamp:((? can anybody post some related sample code or links here ? thank you very much ;) any suggestion should be appreciated!:):rose: sincerely, nickong Today is -
hi, all a problem trouble me for a long time. X| and i have been looking for the answer for a long time. but i still can't solve it,i hope somebody can give me a little suggestion. thanks in advance. my dev platform: MFC 7 & Windows Server 2003 my question: i want to subclass my checkbox on a dialogbar, and load my bitmap to the checkbox's face. all of my checkbox were set to push like style here owner-draw mode was set to true . in headfile MyDialogBar.h ====================================================
CBitmapButton m_btnCheck; BOOL InitButtons();
==================================================== in cppfile MyDialogBar.cpp ====================================================BOOL CMyDialogBar::InitButtons() { m_btnCheck.SubclassDlgItem(IDC_TOOLBTN_SELECT, this); m_btnCheck.LoadBitmaps(IDB_BITMAP_ICON_SELECT); }
==================================================== in headfile MainFrm.h ====================================================CMyDialogBar m_myDlgbar;
==================================================== in cppfile MainFrm.cpp ====================================================int CMainFrm::OnCreate(...) { if(!m_myDlgbar.Create(...)) { TRACE0("sorry >_< "); return -1; }; m_myDlgbar.InitButtons(); }
==================================================== Notes:**IDB_BITMAP_ICON_SELECT**
is a ID of bitmap resource file created by resource editor , i want this bitmap loaded on the checkbox button.**IDC_TOOLBTN_SELECT**
is the ID of the CheckBox the checkbox can works fine, but i just cannot put my bitmap on it. why?? :confused::confused: i used to subclass my checkbox and load a bitmap on its face for many times in common dialog application , there is no problems. why i use it in dialogbar, it doesn't work, and no error occured , the checkbox button works fine.:confused: i found something seems to be useful on MS KB, i rewrite my code , and it still does not work, :doh: http://support.microsoft.com/kb/185672 anybody here met this problems before? can you get me out of this swamp:((? can anybody post some related sample code or links here ? thank you very much ;) any suggestion should be appreciated!:):rose: sincerely, nickong Today is