advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the code for this article
Do you agree that the TreeView is underused? Did you find this article useful? Do you have different methods for persisting TreeView nodes or other techniques for extending the control's features? Let us know in the vb.general discussion group.
Partners & Affiliates
advertisement
advertisement
advertisement
Blue Star Average Rating: 4.6/5 | Rate this item | 22 users have rated this item.
 

Making the Most of the VB TreeView Control

Add run-time editing, drag-and-drop features and persistence to the TreeView control.  


advertisement
he TreeView control is one of the most flexible Windows controls. It displays hierarchical data and lets users navigate through the hierarchy by expanding and collapsing nodes at will. I may be slightly biased, but I think it's an awesome tool for building functional Windows interfaces. Yet TreeView controls haven't received the attention they deserve, probably because, as delivered, they're not easy to use in many real-world situations, where users must be able to insert, delete, edit, rearrange, and save the items. This tutorial shows you how to solve these problems.


The downloadable TVEdit sample application (see Figure 1), demonstrates a range of TreeView techniques. It lets you populate a TreeView control at run time, edit the node text, drag and drop nodes, moving them from one position to another, persist the nodes to an XML file and reload a TreeView control from the persisted XML file at some future point.

 
Figure 1. The TVEdit project demonstrates how to edit a TreeView control at run time and persist its nodes.
  Next Page: Define Keyboard Mappings


Page 1: IntroductionPage 4: Persisting the Nodes Collection
Page 2: Define Keyboard MappingsPage 5: Reading Back the Persisted Nodes
Page 3: Implementing Node Drag-and-Drop 
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs