Tree exercise in C # [closed]

-1

I would like to add functionality to my button, I want that by pressing the button it is added to the tree that has the name of tvwarbol.

Would it be something like that?

private void button1_Click(object sender, EventArgs e)
        {
            tvwarbol.Nodes.Add();
        }
    
asked by El Barto 28.02.2018 в 18:47
source

1 answer

1
private void button1_Click(object sender, EventArgs e) {
   if (rbrama.Checked){

        treeView1.Nodes.Add(textBox1.Text);

    }
    else if (rbhijo.Checked)
    {
        TreeNode objNode;
        objNode = treeView1.SelectedNode;
        objNode.Nodes.Add(textBox1.Text);

    }
    else
    {
        MessageBox.Show("Ha de rellenar el formulario");
    }
}
    
answered by 28.02.2018 / 19:12
source