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

CTreeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 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.
  • C Offline
    C Offline
    CDRAIN
    wrote on last edited by
    #1

    Hi, I set BOLD the selected item (using TVIS_BOLD), but when I de-select it I'm not able to reset the previews font (Non-Bold). How can I perform this?

    P 1 Reply Last reply
    0
    • C CDRAIN

      Hi, I set BOLD the selected item (using TVIS_BOLD), but when I de-select it I'm not able to reset the previews font (Non-Bold). How can I perform this?

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      You have to clear the TVIS_BOLD flag bit. Use SetItemState() with zero as the state and TVIS_BOLD as the mask.


      Darker than a black steer's tookus on a moonless praire night

      Within you lies the power for good, use it!!!

      C M 2 Replies Last reply
      0
      • P PJ Arends

        You have to clear the TVIS_BOLD flag bit. Use SetItemState() with zero as the state and TVIS_BOLD as the mask.


        Darker than a black steer's tookus on a moonless praire night

        Within you lies the power for good, use it!!!

        C Offline
        C Offline
        CDRAIN
        wrote on last edited by
        #3

        Thanks a lot it's work fine. Another question.. and If I need to set BOLD the item only if it haven't no child and reset it only if the new selected item hasn't no child too?? I hope to explain well my doubt.

        P 1 Reply Last reply
        0
        • P PJ Arends

          You have to clear the TVIS_BOLD flag bit. Use SetItemState() with zero as the state and TVIS_BOLD as the mask.


          Darker than a black steer's tookus on a moonless praire night

          Within you lies the power for good, use it!!!

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

          you have to know what item (HTREEITEM) was selected to be able to deselect it. As I understand the OP, he want to bold the selected item, and if he clicks on another item, it will/should deselect (unbold) the previous item and select (bol) the new one.


          Maximilien Lincourt Your Head A Splode - Strong Bad

          C 1 Reply Last reply
          0
          • M Maximilien

            you have to know what item (HTREEITEM) was selected to be able to deselect it. As I understand the OP, he want to bold the selected item, and if he clicks on another item, it will/should deselect (unbold) the previous item and select (bol) the new one.


            Maximilien Lincourt Your Head A Splode - Strong Bad

            C Offline
            C Offline
            CDRAIN
            wrote on last edited by
            #5

            Ok,you understand the OP, but I must deselect the previous item only if the new one have no child. How to control this on event handler?

            1 Reply Last reply
            0
            • C CDRAIN

              Thanks a lot it's work fine. Another question.. and If I need to set BOLD the item only if it haven't no child and reset it only if the new selected item hasn't no child too?? I hope to explain well my doubt.

              P Offline
              P Offline
              PJ Arends
              wrote on last edited by
              #6

              Use GetChildItem to check if the item in question has any child items.


              Darker than a black steer's tookus on a moonless praire night

              Within you lies the power for good, use it!!!

              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