TreeView in vb.net

I am building client / server app, and trying to use the treeview.
I want vertical scroll bar but not horizontal scrollbar.

The only property for the treeview I see is "Scrollable"

How do I make it scroll only vertically, not horizontally.

Currently, it is giving me a horizontal scroll bar, even though the length of the text in the tree does not warrant a horizontal scrollbar.
It is not giving me a vertical scrollbar, because the vertical scroll bar is not necessary with the amount I have stored in the tree.  It should behave the same for horizontal scrollbar, but it doesn't.  I.e.  if you can fit everything for each node horizontally, then don't show me the horizontal scroll bar!....  How do I make it bahave this way?
kamleshmistryAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
There is a little bug with the tree view and Windows XP where you can't load the nodes at design time, you need to put some code in the Form_Load event to fix that.

Bob
0
 
Bob LearnedCommented:
Are you using Windows XP?  How and when are the nodes created?

Bob
0
 
kamleshmistryAuthor Commented:
Yes, I am using windows xp.
Nodes are created design time, but some some nodes are also created run time....
0
 
kamleshmistryAuthor Commented:
I have not tried bob's suggestion, but I do not wan to keep this question open forever...
Will go ahead and reward the points...but I have not yet confirmed....
0
 
captainredaCommented:
In VB.NET VS2008 treeview scrollbar doesnot show either specifically if the treeview contains all the nodes.
The length of the treeview versus the screen width doesnot seems to be taken into account.
So what I did was to compute a treeview length and reduce it by a small value, as a result the vertical scroll bar was displayed.

TreeView.Height = (17 * (TreeView.Nodes.Count - 10))
Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.