Link to home
Start Free TrialLog in
Avatar of kamleshmistry
kamleshmistry

asked on

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?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Are you using Windows XP?  How and when are the nodes created?

Bob
Avatar of kamleshmistry
kamleshmistry

ASKER

Yes, I am using windows xp.
Nodes are created design time, but some some nodes are also created run time....
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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....
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