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. Multiple selection on Tree Control

Multiple selection on Tree Control

Scheduled Pinned Locked Moved C / C++ / MFC
comdata-structureshelpquestion
8 Posts 3 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.
  • D Offline
    D Offline
    dliviu
    wrote on last edited by
    #1

    I downloaded a project from codeproject that makes multiple selection posibible on a CTreeCtrl. The link is: [^] The downloaded project works fine, I mean it works to select multiple lines with the Ctrl key. I created a project on my own, taking from the downloaded project just CCustomTreeCtrl files, because I need just CCustomTreeCtrl. So, my problem is that it does not work to select multiple lines in the tree control in my project, but in the downloaded project it does. How can this be? I cannot figure it out. I checked and double checked to see if there's any notable difference, and I can't see any.

    D 1 Reply Last reply
    0
    • D dliviu

      I downloaded a project from codeproject that makes multiple selection posibible on a CTreeCtrl. The link is: [^] The downloaded project works fine, I mean it works to select multiple lines with the Ctrl key. I created a project on my own, taking from the downloaded project just CCustomTreeCtrl files, because I need just CCustomTreeCtrl. So, my problem is that it does not work to select multiple lines in the tree control in my project, but in the downloaded project it does. How can this be? I cannot figure it out. I checked and double checked to see if there's any notable difference, and I can't see any.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      D M 3 Replies Last reply
      0
      • D David Crow

        At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        D Offline
        D Offline
        dliviu
        wrote on last edited by
        #3

        Thanks for your reply and for the provided links.

        1 Reply Last reply
        0
        • D David Crow

          At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          D Offline
          D Offline
          dliviu
          wrote on last edited by
          #4

          I tried the code from the second link. It behaves the same as the code from Syed Babu from codeproject. If I select multiple items using Ctrl and left mouse button it selects JUST THE LAST 2 previously selected items; the first item selected in a row of three is always deselected. I don't get it, I have the same code as the original code. There's something strange here.

          1 Reply Last reply
          0
          • D David Crow

            At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            M Offline
            M Offline
            Mohsin Munawar
            wrote on last edited by
            #5

            The code looks fine actually. Can you elaborate the problem you are facing in this code?

            mohsinmunawar [at] gmail [dot] com

            D 2 Replies Last reply
            0
            • M Mohsin Munawar

              The code looks fine actually. Can you elaborate the problem you are facing in this code?

              mohsinmunawar [at] gmail [dot] com

              D Offline
              D Offline
              dliviu
              wrote on last edited by
              #6

              The code I'm refering to is from here: http://www.codeguru.com/cpp/controls/treeview/misc-advanced/article.php/c723/Allowing-multiple-selection.htm[^] There's not much to elaborate. I just took this code, all these functions, and put them in my CTreeCtrlXML class which is derived from CTreeCtrl. And I have the problem I wrote above. I have the same exact problem by using the Syed Babu code from here: MultiSelection Tree Control[^]

              1 Reply Last reply
              0
              • M Mohsin Munawar

                The code looks fine actually. Can you elaborate the problem you are facing in this code?

                mohsinmunawar [at] gmail [dot] com

                D Offline
                D Offline
                dliviu
                wrote on last edited by
                #7

                I cannot attach the two projects here. I don't see any attach button. Can I send you on a private mail the two projects and have a quick look, please?

                M 1 Reply Last reply
                0
                • D dliviu

                  I cannot attach the two projects here. I don't see any attach button. Can I send you on a private mail the two projects and have a quick look, please?

                  M Offline
                  M Offline
                  Mohsin Munawar
                  wrote on last edited by
                  #8

                  Sure that will be great. My email address is: mohsinmunawar [at] gmail [dot] com

                  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