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. Sterile Tree view

Sterile Tree view

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiodata-structuresquestion
4 Posts 2 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
    grassrootkit
    wrote on last edited by
    #1

    Why the below code doesn't make any child? What I see on the list is only "Software".

    HTREEITEM hTree, hCompany;
    hTree = m_cTree.InsertItem("Software", TVI_ROOT);
    hCompany = m_cTree.InsertItem("Microsoft", hTree);
    m_cTree.InsertItem("Office", hCompany);
    m_cTree.InsertItem("Visual Studio", hCompany);
    m_cTree.InsertItem("Servers", hCompany);

    Should I enable any options with the tree?

    _ 1 Reply Last reply
    0
    • G grassrootkit

      Why the below code doesn't make any child? What I see on the list is only "Software".

      HTREEITEM hTree, hCompany;
      hTree = m_cTree.InsertItem("Software", TVI_ROOT);
      hCompany = m_cTree.InsertItem("Microsoft", hTree);
      m_cTree.InsertItem("Office", hCompany);
      m_cTree.InsertItem("Visual Studio", hCompany);
      m_cTree.InsertItem("Servers", hCompany);

      Should I enable any options with the tree?

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Looks like you have done the right thing. So its probably added but not shown. Try by putting m_cTree.Expand(TVI_ROOT, TVE_EXPAND) at the end.

      «_Superman_» I love work. It gives me something to do between weekends.

      G 1 Reply Last reply
      0
      • _ _Superman_

        Looks like you have done the right thing. So its probably added but not shown. Try by putting m_cTree.Expand(TVI_ROOT, TVE_EXPAND) at the end.

        «_Superman_» I love work. It gives me something to do between weekends.

        G Offline
        G Offline
        grassrootkit
        wrote on last edited by
        #3

        You are right. The code was actually right. But it did not display any "expland-collapse-+" symbol at the corner. When I click on it it's actually expanding. But how do I show that "+" there?

        _ 1 Reply Last reply
        0
        • G grassrootkit

          You are right. The code was actually right. But it did not display any "expland-collapse-+" symbol at the corner. When I click on it it's actually expanding. But how do I show that "+" there?

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          The tree control has the Has Buttons and Has Lines properties that you must set to true in the resource editor.

          «_Superman_» I love work. It gives me something to do between weekends.

          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