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?
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?
ASKER
Yes, I am using windows xp.
Nodes are created design time, but some some nodes are also created run time....
Nodes are created design time, but some some nodes are also created run time....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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....
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
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
Bob