Solved

TreeView in vb.net

Posted on 2004-04-13
5
1,375 Views
Last Modified: 2012-04-10
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?
0
Comment
Question by:kamleshmistry
  • 2
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10826477
Are you using Windows XP?  How and when are the nodes created?

Bob
0
 

Author Comment

by:kamleshmistry
ID: 10865406
Yes, I am using windows xp.
Nodes are created design time, but some some nodes are also created run time....
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 130 total points
ID: 10867957
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
 

Author Comment

by:kamleshmistry
ID: 10970150
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
 

Expert Comment

by:captainreda
ID: 37830094
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

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now