Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
How to use a treeview control (Saturday, August 28, 2004)
 

Found the following interesting discussion in the Newsgroups:

Treeview control
by:Rich

Hi,

I have a treeview in a Windows form. I want to be able to set a node as default when the form opens programmatically. Can anyone tell me how this can be done in vb.net (I think you use SelectedNode but I can't get this to work)??

Best Regards
Rich


 Reply:
by:Robin Tucker

 Yes, you set SelectedNode to the node you want selected. However, you will
need to "find" this node by traversing the tree (or, like me, by looking it up in a hashtable relation of key to treenode).


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 

\\Me.TreeView1.SelectedNode = Me.TreeView1.Nodes(10)
///

--
Herfried K. Wagner [MVP]
URL:http://dotnet.mvps.org/


 Reply:
by:Rich

 Thanks Herfried, that worked perfectly.

Richard



Posted by Xander Zelders



 
Previous Posts
    - Clipboard in console application
    - How to manage a listbox from javascript
    - Deploying MSDE with VB.net
    - Remove a line from a text file
    - Remove the last line in a text file
    - How to launch a .doc or .exe file with VB.NET
    - How to send a file with VB.NET
    - How to add handle at runtime to comboboxes
    - Calling VB.Net Class File from Delphi
    - static class members in VB

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland