Solved

TreeView in vb.net

Posted on 2004-04-13
5
1,365 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
Comment Utility
Are you using Windows XP?  How and when are the nodes created?

Bob
0
 

Author Comment

by:kamleshmistry
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

12 Experts available now in Live!

Get 1:1 Help Now