C # application of the Treeview Control

Source: Internet
Author: User

Using system;
Using system. Collections. Generic;
Using system. componentmodel;
Using system. Data;
Using system. drawing;
Using system. text;
Using system. Windows. forms;

Namespace Treeview
{
Public partial class frmtreeview: Form
{
Public frmtreeview ()
{
Initializecomponent ();
}

Private void btnadd_click (Object sender, eventargs E)
{
Treenode Tn = new treenode (); // New Class
Tn. Text = "show new node"; // text displayed on the node
Treeview1.nodes. Add (TN); // Add a node

}

private void btnaddb_click (Object sender, eventargs E)
{< br> treenode Tn = new treenode (); // new class
tn. TEXT = "show new subnodes"; // text displayed on the subnode
treeview1.nodes [0]. nodes. add (TN); // Add a subpoint
}

private void btnaddbb_click (Object sender, eventargs E)
{< br> treenode Tn = new treenode (); // new class
tn. TEXT = "show new nodes"; // text displayed on the node
treeview1.nodes [0]. nodes [1]. nodes. add (TN); // Add a node
}

private void button2_click (Object sender, eventargs E)
{< br> treenode Tn = new treenode (); // new class
tn. TEXT = "show new nodes"; // text displayed on the node
treeview1.selectednode. nodes. add (TN); // select any node to add
}

Private void button#click (Object sender, eventargs E)
{
Treenode Tn = new treenode (); // New Class
Tn. Text = "show new node"; // text displayed on the node
Treeview1.selectednode. Parent. nodes. Add (TN); // Add peer nodes

}

private void frmtreeview_load (Object sender, eventargs E)
{< br> treenode Tn = new treenode ();
tn. TEXT = "trunk";
treeview1.nodes. add (TN);
}< BR >}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.