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. Expanding items in CTreeCtrl

Expanding items in CTreeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorial
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.
  • S Offline
    S Offline
    Sakhalean
    wrote on last edited by
    #1

    Hi all, How to expand collapse a tree control all child items with a single function.

    L J J 4 Replies Last reply
    0
    • S Sakhalean

      Hi all, How to expand collapse a tree control all child items with a single function.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      CTreeCtrl::Expand[^] should do what you mean? If you want to expand an item and expand all child items too, you'll have to loop through them.

      1 Reply Last reply
      0
      • S Sakhalean

        Hi all, How to expand collapse a tree control all child items with a single function.

        J Offline
        J Offline
        jk chan
        wrote on last edited by
        #3

        you can do it by calling the function CTreeCtrl::Expand function like ctrl.Expand( hCurrentParent,TVE_EXPAND ); if you have multiple items at the most outer level , you need to call Exapand function for each of the items. you can use GetNextItem in CTreeCtrl for getting items. http://msdn.microsoft.com/en-US/library/a1azz3kt(v=VS.80).aspx[^]

        If u can Dream... U can do it

        1 Reply Last reply
        0
        • S Sakhalean

          Hi all, How to expand collapse a tree control all child items with a single function.

          J Offline
          J Offline
          janaswamy uday
          wrote on last edited by
          #4

          Hi, Refer for BOOL Expand( HTREEITEM hItem, UINT nCode ); Method in MSDN. You can achieve that. Thanks, Uday.

          1 Reply Last reply
          0
          • S Sakhalean

            Hi all, How to expand collapse a tree control all child items with a single function.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Two people giving the exact same answer as me, it must be true ;)

            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