Skip to content

Treeview with node in c#

Diego Alejandro

Asked Mar 7, 2008, 7:15 AM EST1 answer
Share
LinkedInX
my english is so so...
how can i do to build a node with treeview

-System info
       -driver
        -hotfix


void treeView1_NodeMouseClick(object sender,  
    TreeNodeMouseClickEventArgs e)
{
    textBox1.Text = e.Node.Text;
}

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Not sure what you mean but

    To add a tree node to your tree view

    simplest form:
        treeView1..SelectedNode.Nodes.Add(new TreeNode("node text")
    this will add a child node to the node which is selected in your tree view.


    void treeView1_NodeMouseClick(object sender,  
        TreeNodeMouseClickEventArgs e)
    {
        textBox1.Text = e.Node.Text;

        treeView1..SelectedNode.Nodes.Add(new TreeNode(
    textBox1.Text));
    }

    Hope this helps
    0