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. WPF
  4. TreeView vertical scrollbar bug

TreeView vertical scrollbar bug

Scheduled Pinned Locked Moved WPF
helpdesigndata-structuresquestion
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.
  • S Offline
    S Offline
    Steve The Plant
    wrote on last edited by
    #1

    Hello, I have a problem with my TreeView not showing the vertical scrollbar correctly. I have plain old TreeView without any kind of style, item template or anything. If I add so many items that they start to appear past the TreeView window, I get a vertical scroll bar. This is pretty standard stuff, I know. But the problem is that the scrollbar itself is strange. Both the up/down scroll bar buttons, which are usually located at the top and bottom of the scrollbar, both appear at the top. Plus, there's no scroll bar thumb between them. I don't know why this is happening. In the design window, the scrollbar is normal. I just find it strange since my tree view is so basic. Any ideas? Thanks!

    A 1 Reply Last reply
    0
    • S Steve The Plant

      Hello, I have a problem with my TreeView not showing the vertical scrollbar correctly. I have plain old TreeView without any kind of style, item template or anything. If I add so many items that they start to appear past the TreeView window, I get a vertical scroll bar. This is pretty standard stuff, I know. But the problem is that the scrollbar itself is strange. Both the up/down scroll bar buttons, which are usually located at the top and bottom of the scrollbar, both appear at the top. Plus, there's no scroll bar thumb between them. I don't know why this is happening. In the design window, the scrollbar is normal. I just find it strange since my tree view is so basic. Any ideas? Thanks!

      A Offline
      A Offline
      ABitSmart
      wrote on last edited by
      #2

      Mine just works noraml. Are you setting any styles ?? might be the reason.

      S 1 Reply Last reply
      0
      • A ABitSmart

        Mine just works noraml. Are you setting any styles ?? might be the reason.

        S Offline
        S Offline
        Steve The Plant
        wrote on last edited by
        #3

        As I mentioned, there are no styles or anything applied to my tree view. Here's an example as basic as I can make it. I'm absolutely stumped. And it occurs on my collegues' computers as well.

        P S 2 Replies Last reply
        0
        • S Steve The Plant

          As I mentioned, there are no styles or anything applied to my tree view. Here's an example as basic as I can make it. I'm absolutely stumped. And it occurs on my collegues' computers as well.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Do you see the horizontal scrollbar? What happens if you stretch the window horizontally, and then expand the treeview? I've just run your sample and it behaves the way I'd expect it to - you see the small vertical scrollbar because there's a horizontal scrollbar taking up space.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys

          1 Reply Last reply
          0
          • S Steve The Plant

            As I mentioned, there are no styles or anything applied to my tree view. Here's an example as basic as I can make it. I'm absolutely stumped. And it occurs on my collegues' computers as well.

            S Offline
            S Offline
            Steve The Plant
            wrote on last edited by
            #5

            I fiddled a bit with my code and found the cause, even though I don't really understand why. My application uses a directx renderer from a DLL that's written in C++. To init the renderer, I pass it the WPF window's hwnd by using WindowInteropHelper. Now the interesting bit: If I init the renderer before creating and showing my modeless dialogs (the ones with the scrollbar problem), the scrollbars don't appear correctly. But if I init the renderer *after* creating the dialogs, the scrollbars are fine. If anyone has an idea of why this happens, I'd be happy to hear 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