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 - Get the number of the selected item

CTreeCtrl - Get the number of the selected item

Scheduled Pinned Locked Moved C / C++ / MFC
questionmcpdata-structures
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.
  • G Offline
    G Offline
    Gagnon Claude
    wrote on last edited by
    #1

    Hi, I have a CTreeCtrl in an application. When I click on an item, I want to do a particuliar action. To do that, I have to know the number of the item in the tree: first, second, third an so on. How can I retreive that information ? Thanks, Claude

    D S 2 Replies Last reply
    0
    • G Gagnon Claude

      Hi, I have a CTreeCtrl in an application. When I click on an item, I want to do a particuliar action. To do that, I have to know the number of the item in the tree: first, second, third an so on. How can I retreive that information ? Thanks, Claude

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

      Are tree controls supposed to be viewed that way. What happens to items 2..N when item 1 is expanded? Does item 2 become item 3, etc? I would opt for using SetItemData() for each item/node in the tree.

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "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

      1 Reply Last reply
      0
      • G Gagnon Claude

        Hi, I have a CTreeCtrl in an application. When I click on an item, I want to do a particuliar action. To do that, I have to know the number of the item in the tree: first, second, third an so on. How can I retreive that information ? Thanks, Claude

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        Gagnon Claude wrote:

        To do that, I have to know the number of the item in the tree: first, second, third an so on

        Number in the tree....how are you counting? Breadth first? Depth first? And why do you need that - are you sure there's no other way of achieveing your objective?

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        L 1 Reply Last reply
        0
        • S Stuart Dootson

          Gagnon Claude wrote:

          To do that, I have to know the number of the item in the tree: first, second, third an so on

          Number in the tree....how are you counting? Breadth first? Depth first? And why do you need that - are you sure there's no other way of achieveing your objective?

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Stuart Dootson wrote:

          how are you counting?

          See there's this roulette wheel and :jig:

          S 1 Reply Last reply
          0
          • L led mike

            Stuart Dootson wrote:

            how are you counting?

            See there's this roulette wheel and :jig:

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #5

            ;P

            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