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. tree ctrl vertical scroll bar

tree ctrl vertical scroll bar

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
3 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.
  • D Offline
    D Offline
    Dave Bryant
    wrote on last edited by
    #1

    Does anyone know if it is possible to place the vertical scrollbar within the tree control on the left-hand side of the window, rather than the right (while still displaying left-to-right text)? Dave

    P 1 Reply Last reply
    0
    • D Dave Bryant

      Does anyone know if it is possible to place the vertical scrollbar within the tree control on the left-hand side of the window, rather than the right (while still displaying left-to-right text)? Dave

      P Offline
      P Offline
      peterchen
      wrote on last edited by
      #2

      I don't know if it's possible to retrieve the scrollbars provided by the tree control to set the SBS_LEFTALIGN style (I once read a discussion about, but I don't remember the conclusion...) However, you could always do the following: a) make the tree control big enough to be without scroll bars (you need to calc the "ideal height" for it anyway - but that's no big problem) b) create your own scroll bar with SBS_LEFTALIGN c) set the correct clipping style for the parent (I think it should be WS_CLIPCHILDREN) d) handle the scroll events by moving the tree control's y position e) Handle selection changes correctly, so the selection is always inside the tree --- f) TVM_GETITEMRECT will prove invaluable for all these tasks ;) g) if you expect a horizontal scrollbar as well, you should implement it on your own in a similar way. it looks dead ugly otherwise Yeah, a lot of work (and I don't really see the benefit of an left-aligned scrollbar over it's "non-standardness". But you decide ;) )


      If you go to war, you will destroy a great country a stoned greek chick to the richest man of the world
      sighist | Agile Programming | doxygen

      D 1 Reply Last reply
      0
      • P peterchen

        I don't know if it's possible to retrieve the scrollbars provided by the tree control to set the SBS_LEFTALIGN style (I once read a discussion about, but I don't remember the conclusion...) However, you could always do the following: a) make the tree control big enough to be without scroll bars (you need to calc the "ideal height" for it anyway - but that's no big problem) b) create your own scroll bar with SBS_LEFTALIGN c) set the correct clipping style for the parent (I think it should be WS_CLIPCHILDREN) d) handle the scroll events by moving the tree control's y position e) Handle selection changes correctly, so the selection is always inside the tree --- f) TVM_GETITEMRECT will prove invaluable for all these tasks ;) g) if you expect a horizontal scrollbar as well, you should implement it on your own in a similar way. it looks dead ugly otherwise Yeah, a lot of work (and I don't really see the benefit of an left-aligned scrollbar over it's "non-standardness". But you decide ;) )


        If you go to war, you will destroy a great country a stoned greek chick to the richest man of the world
        sighist | Agile Programming | doxygen

        D Offline
        D Offline
        Dave Bryant
        wrote on last edited by
        #3

        I didn't think it was easy... The reason i wanted one was because i have two tree controls next to each other and i'm drawing lines between them - the scrollbar is sort of in the way. Dave

        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