Friday, July 3, 2009

TreeView AutoScroll

When the number of tree nodes in Windows Forms Treeview control exceeds particular number of nodes, the user may want to scroll the tree view.

The Windows Forms Treeview control does not include built-in functionality to autoscroll.


The solution is to

place the treeview in a panel
set the dock property of treeview to dockstyle.Fill
set the panel's AutoScroll property to true



So if the treeview becomes larger, the panel will display autoscroll bar.

No comments:

Post a Comment