We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 124,813 times

Contents

Downloads

Related Categories

TreeView Control - Expanding Items

Expanding Items

If you want to make sure a node is visible, you can use the EnsureVisible method:

TreeView1.Nodes(21).EnsureVisible

This will expand any items, and scroll as required to ensure that the item specified is visible.

If a node has child items, a + appears next to it. The user can press this to show the child items. When the user expands an node, the Expand event occurs. Once the node has been expanded, a - appears next to it. When this is pressed, the child items are hidden, and the Collapse event occurs

James first started writing tutorials on Visual Basic in 1999 whilst starting this website (then known as VB Web). Since then, the site has grown rapidly, and James has written numerous tutorials, articles and reviews on VB, PHP, ASP and C#. In October 2003, James formed the company Developer Fusion Ltd, which owns this website, and also offers various development services. In his spare time, he's a 3rd year undergraduate studying Computer Science in the UK. He's also a Visual Basic MVP.

Comments

  • treeview

    Posted by jmhshep on 03 Mar 2005

    I tried your treeview example and when I try to add and image it is telling me that I need to initilaize the image first. Can you tell me what that means and how to fix it

  • treeview

    Posted by directorz on 28 May 2004

    I tried this and recieved the following: Compile error: variable not defined..."TreeView" is highlited...anyone have any ideas?

  • Good & Thanks

    Posted by gabar on 14 May 2004

    Very Good, You have helped me.

    gabriel medina
    gxsoft@hotmail.com

  • Good

    Posted by behmagvb on 11 Aug 2003

    Good Example isn't it?
    http://www.pldental.com

  • ??? Got Problems with that

    Posted by LittleMik on 24 Jun 2003

    Hi,

    Found this very good tutorial because its nearly exact the problem i have with my TreeView,...
    ...but unfortunatly, i can't get it to work...

    Set the same settings like in the tutorial, but...