3xodus Posted July 18, 2005 Posted July 18, 2005 (edited) Hi again :) I've spent too much time reading around for information on this, and trying for myself.. I know it's probably something obvious that I'm not going to find.. I have a TreeView that scrolls vertically due to the amount of nodes, but *dosen't* scroll horizontally as there are no nodes wide enough to need it. However as a part of my app I have to set TreeView.Scrollable = false;, and later on, back to = true;. When Scrollable = true again, there's a vertical and horizontal scrollbar. None of the nodes have changed, they're all still far from needing horizontal scrolling. It seems that setting the .Scrollable property to true at runtime just automatically adds both scrollbars. As a side not, the horizontal scrollbar won't even actually scroll. Just to show how pointless it is that it even appears :) Is it possible to get rid of the horizontal, and leave the vertical one there? I can't see any properties for this, but I'm hoping there's something... Thanks for any info guys ;) [EDIT @ 19th July, 21:30] I've still not found anything on this unfortunately, however my problem is solved as I've found an alternative way of doing it... I'm still interested to see if this is possible though, if anyone knows. Edited July 19, 2005 by 3xodus Quote Using: Visual Studio 2005/08 Languages: C#, Win32 C++, Java, PHP
*Experts* DiverDan Posted July 20, 2005 *Experts* Posted July 20, 2005 Did you account for the width of the vertical scroll bar in the sizing of the treeview width? I think the Windows default widths are 16 for Win 2K and 17 for XP. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
3xodus Posted July 20, 2005 Author Posted July 20, 2005 (edited) Thanks for your thoughts, though my treeview is more than wide enough. The treeview's width is 197, much wider than any of the nodes. I've tested with nodes 1 character in length, and the result is the same. I am now fairly sure that setting the .Scrollable property to true at runtime just adds both scrollbars regardless of the contents of the treeview. Since I'm using C# 2005 beta 2, I'm hoping that the option is added in the final release to choose scrollbars (maybe boolean treeView.HScrollable and treeView.VScrollable) though it's not such a big deal. Edited July 20, 2005 by 3xodus Quote Using: Visual Studio 2005/08 Languages: C#, Win32 C++, Java, PHP
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.