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 and MFC Dialog

CTreeCtrl and MFC Dialog

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

    hi, i want to disable the possibility to change the label of an item of a CTreeCtrl. SetReadOnly() namely makes it possible that the user can't edit the item's label, but the edit control box is still displayed and that shouldn't happen. Any ideas ? Thanks in advance!

    H M M 3 Replies Last reply
    0
    • H hph

      hi, i want to disable the possibility to change the label of an item of a CTreeCtrl. SetReadOnly() namely makes it possible that the user can't edit the item's label, but the edit control box is still displayed and that shouldn't happen. Any ideas ? Thanks in advance!

      H Offline
      H Offline
      hph
      wrote on last edited by
      #2

      I got it. Maybe someone is interested in how i did it, so here is the solution. If the message TVN_BEGINLABELEDIT is send, i dispatch the follwoing notification: SendMessage(TVM_ENDEDITLABELNOW, (WPARAM) (BOOL) TRUE, 0); Looks simple, isn't it?!

      1 Reply Last reply
      0
      • H hph

        hi, i want to disable the possibility to change the label of an item of a CTreeCtrl. SetReadOnly() namely makes it possible that the user can't edit the item's label, but the edit control box is still displayed and that shouldn't happen. Any ideas ? Thanks in advance!

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        Handle TVN_BEGINLABELEDIT, returning TRUE to prevent editing.

        1 Reply Last reply
        0
        • H hph

          hi, i want to disable the possibility to change the label of an item of a CTreeCtrl. SetReadOnly() namely makes it possible that the user can't edit the item's label, but the edit control box is still displayed and that shouldn't happen. Any ideas ? Thanks in advance!

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          In the dialog editor, turn off the "edit labels" style of the tree control. --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber CP SearchBar v2.0.2 released

          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