Kiran's personal website
Blog    Forums   Sitemap   Social    Phone

Knowledge base home, and site home.
List of all Knowledge base categories.
An alphabetical list of technical terms.
Contact Me
Contact me for knowledge base questions
My Blog
My articles, white papers, ideas and thoughts.


Populating tree nodes of a Tree view control in C#.NET

Date Added January 1, 1970 | Print | Bookmark
//How can I populate tree nodes of a Tree View Control in C#.NET?

//Code by Kiran Reddy
//First add one parent node to the Tree View control in its properties, select the parent node, to add child nodes to the Tree view add following code to button click events

TreeNode tvnode = new TreeNode("your_Node_Name");
if(treeView1.SelectedNode.Nodes.Count > 1 && treeView1.SelectedNode.ForeColor != Color.Blue)
treeView1.SelectedNode.ForeColor = Color.Green;

//Add siblings to treeview

TreeNode tvnode = new TreeNode("your_Node_Name");
tvnode.ForeColor = Color.Brown;

//Delete selected node

Was this article helpful?

Yes No

Category: C#.NET - Windows

Last updated on January 1, 1970 with 8715 views

0 User Comments

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Security code


Home | About Me | Products | Support | Contact | Knowledgebase | Forums | Blog | Site map | Site Search | Subscribe | Links | Social | News

Travel | Guest Book | All Pages | History | Site Calendar | Recipes | Ex-Rates | UK Stuff | Downloads | Telugu Stuff | Tell a Friend | Feedback

Bookmark and Share
Terms of Use
Site contents Copyright © 2008-2009 Kiran Reddy. All rights reserved.