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. CTreeCtrl and SetCheck

CTreeCtrl and SetCheck

Scheduled Pinned Locked Moved C / C++ / MFC
5 Posts 4 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.
  • M Offline
    M Offline
    Matt Gullett
    wrote on last edited by
    #1

    I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?

    D K C 3 Replies Last reply
    0
    • M Matt Gullett

      I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?

      D Offline
      D Offline
      Derek Waters
      wrote on last edited by
      #2

      I'm just guessing here, but it could be that the tree needs to be redrawn. Try the following:

      VERIFY(m_wndTree.SetCheck(hSel, TRUE));
      m_wndTree.Invalidate();

      ------------------------ Derek Waters derek@lj-oz.com

      M 1 Reply Last reply
      0
      • D Derek Waters

        I'm just guessing here, but it could be that the tree needs to be redrawn. Try the following:

        VERIFY(m_wndTree.SetCheck(hSel, TRUE));
        m_wndTree.Invalidate();

        ------------------------ Derek Waters derek@lj-oz.com

        M Offline
        M Offline
        Matt Gullett
        wrote on last edited by
        #3

        Nope, that's not the problem.

        1 Reply Last reply
        0
        • M Matt Gullett

          I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?

          K Offline
          K Offline
          Ken Goguen
          wrote on last edited by
          #4

          I had the same problem Do a search on "Check boxes in CTreeCtrl" and take a look at the second reply from Tomasz Sowinski. This corrected my problem. -kg Ken Goguen

          1 Reply Last reply
          0
          • M Matt Gullett

            I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?

            C Offline
            C Offline
            Carlos Antollini
            wrote on last edited by
            #5

            Is hParent a valid HTREEITEM? Did You make a refresh? Regards!!!! Carlos Antollini. Sonork ID 100.10529 cantollini

            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