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
data-structureshelp
5 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.
  • U Offline
    U Offline
    User 423850
    wrote on last edited by
    #1

    Hello Friends, I am Having a tree ctrl in a dialog box now when i set the checkbox property of the tree ctrl then there is a very Long Horizontal scroll bar at the bottom of the TreeCtrl. This scroll bar is very long even if the length of the string inserted in the treectrl is small Can anyone help me out in removing the horizontal scroll, but i want the Vertical Scroll... Thanx TAKE CARE

    A 1 Reply Last reply
    0
    • U User 423850

      Hello Friends, I am Having a tree ctrl in a dialog box now when i set the checkbox property of the tree ctrl then there is a very Long Horizontal scroll bar at the bottom of the TreeCtrl. This scroll bar is very long even if the length of the string inserted in the treectrl is small Can anyone help me out in removing the horizontal scroll, but i want the Vertical Scroll... Thanx TAKE CARE

      A Offline
      A Offline
      Antti Keskinen
      wrote on last edited by
      #2

      Is your dialog based on a prepared resource ? If it is, then override the OnCreate method of your dialog class, and first call the base class to create the dialog and control windows. Use Class Wizard to bind a control member for the tree control. When the base class call returns, use the member variable to check if the control window is created (m_hWnd member of variable is not null) Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. If you create the list control dynamically, you can leave the WS_HSCROLL flag out from the Create method call. This will remove the horizontal bar. Including the WS_VSCROLL flag will ensure that the vertical scroll bar remains. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      S 1 Reply Last reply
      0
      • A Antti Keskinen

        Is your dialog based on a prepared resource ? If it is, then override the OnCreate method of your dialog class, and first call the base class to create the dialog and control windows. Use Class Wizard to bind a control member for the tree control. When the base class call returns, use the member variable to check if the control window is created (m_hWnd member of variable is not null) Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. If you create the list control dynamically, you can leave the WS_HSCROLL flag out from the Create method call. This will remove the horizontal bar. Including the WS_VSCROLL flag will ensure that the vertical scroll bar remains. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

        S Offline
        S Offline
        Shehzad Salim
        wrote on last edited by
        #3

        Antti Keskinen wrote: Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. well but what if I really have something in my tree control which needs to have a horizontal scrollbar

        A 1 Reply Last reply
        0
        • S Shehzad Salim

          Antti Keskinen wrote: Set the window style flags using the member variable and ModifyStyle method to remove the WS_HSCROLL flag. This will remove the horizontal scrollbar. well but what if I really have something in my tree control which needs to have a horizontal scrollbar

          A Offline
          A Offline
          Antti Keskinen
          wrote on last edited by
          #4

          I believe the only option for the tree control here is that the horizontal scrollbar is either on or off. If you need a special implementation (variable on/off scrollbar), then derive from CTreeCtrl and draw the horizontal scrollbar yourself when necessary. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

          U 1 Reply Last reply
          0
          • A Antti Keskinen

            I believe the only option for the tree control here is that the horizontal scrollbar is either on or off. If you need a special implementation (variable on/off scrollbar), then derive from CTreeCtrl and draw the horizontal scrollbar yourself when necessary. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

            U Offline
            U Offline
            User 423850
            wrote on last edited by
            #5

            Thank you Friends it works.... Thanx TAKE CARE

            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