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. TreeCtrl in MFC

TreeCtrl in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structuresquestion
7 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.
  • J Offline
    J Offline
    Jhony george
    wrote on last edited by
    #1

    hi, i have a tree ctrl with Number of items say 10 items under one root Node, at the end of each child item i need to add an image . How is this Possible ? Thanks,

    Born to win...!

    L M 2 Replies Last reply
    0
    • J Jhony george

      hi, i have a tree ctrl with Number of items say 10 items under one root Node, at the end of each child item i need to add an image . How is this Possible ? Thanks,

      Born to win...!

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

      Here is a quick and easy guide to MFC CTreeCtrl.

      Life is a stage and we are all actors!

      J 1 Reply Last reply
      0
      • J Jhony george

        hi, i have a tree ctrl with Number of items say 10 items under one root Node, at the end of each child item i need to add an image . How is this Possible ? Thanks,

        Born to win...!

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        You need to owner draw the items. (search for NM_CUSTOMDRAW on msdn ) but if you want to add an image at the "beginning" of each item, you can simply use CTreeCtrl::SetItemImage. M.

        Watched code never compiles.

        J 2 Replies Last reply
        0
        • L Lost User

          Here is a quick and easy guide to MFC CTreeCtrl.

          Life is a stage and we are all actors!

          J Offline
          J Offline
          Jhony george
          wrote on last edited by
          #4

          hi, My objective is end of each child item i need to add a image. Example : Root | Child 1 text [image] Child 2 text [image] Child 3 text [image] Child 4 text [image] above [image] -> image of size 12*12

          Born to win...!

          1 Reply Last reply
          0
          • M Maximilien

            You need to owner draw the items. (search for NM_CUSTOMDRAW on msdn ) but if you want to add an image at the "beginning" of each item, you can simply use CTreeCtrl::SetItemImage. M.

            Watched code never compiles.

            J Offline
            J Offline
            Jhony george
            wrote on last edited by
            #5

            hi, Thanks for ur kind reply, Do we have any sample program for that..? it will be more helpful to complete.

            Born to win...!

            M 1 Reply Last reply
            0
            • J Jhony george

              hi, Thanks for ur kind reply, Do we have any sample program for that..? it will be more helpful to complete.

              Born to win...!

              M Offline
              M Offline
              Maximilien
              wrote on last edited by
              #6

              i'm certain you can find some examples here on codeproject.

              Watched code never compiles.

              1 Reply Last reply
              0
              • M Maximilien

                You need to owner draw the items. (search for NM_CUSTOMDRAW on msdn ) but if you want to add an image at the "beginning" of each item, you can simply use CTreeCtrl::SetItemImage. M.

                Watched code never compiles.

                J Offline
                J Offline
                Jhony george
                wrote on last edited by
                #7

                NM_CUstomDraw i have gone through this, but hope we have text property on that. have not seen the image property on that.

                Born to win...!

                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