TreeView vertical scrollbar bug
-
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!
-
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!
-
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.
-
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.
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.
-
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.
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! :)