Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to SubClass a checkbox on a DialogBar

How to SubClass a checkbox on a DialogBar

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++comgraphics
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ray Guan
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • R Ray Guan

      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

      R Offline
      R Offline
      Ray Guan
      wrote on last edited by
      #2

      any help? Today is a gift, that's why we call it present

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups