Programmatically scrolling a treeview

mscdex

Member
Joined
Feb 21, 2007
Messages
5
Programming Experience
5-10
I have a standard Treeview control that I'm populating with a bunch of different nodes (all are off the root node). The treeview automatically resizes itself to fit the contents of the text in the nodes. Because of this, the Treeview can grow to be larger than the current resolution's height. I didn't want to use an unsightly scrollbar in my case, so I disabled the Scrollable property in hopes that I could implement something along the lines of how Windows (and Litestep as well for that matter) scroll the Start-> Programs menu when that menu is too big for the screen. In the latter situation you simply move your mouse close to the top edge or the bottom edge and it beings to automatically scroll in that direction. This is the sort of effect I am looking to accomplish with the Treeview. If this isn't possible with the stock Treeview control, is it possible to do this in a Treeview that inherits the stock one?


EDIT: I'm going to answer my own question here, apparently you can set Scrollable to True and then use the ShowScrollBar API to hide the scrollbars but still keep scrolling capabilities.
 
Last edited:
Back
Top