title: How to add/remove child nodes from textbox to the selected node in combobox
body: <p><a href="https://i.stack.imgur.com/TYH2u.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TYH2u.jpg" alt="enter image description here"></a></p>
  
  <ul>
  <li>I'm adding items from combobox to treeview at run-time.</li>
  </ul>
  
  <p>The code goes as follows: </p>
  
  <pre><code> private void Form1_Load(object sender, EventArgs e)
      {
          comboBox1.SelectedIndex = 0;
  
          string[] items = new string[comboBox1.Items.Count];
  
          for (int i = 0; i &lt; comboBox1.Items.Count; i++)
          {
              items[i] = comboBox1.Items[i].ToString();
              treeView1.Nodes.Add(items[i]);
          }
      }
  </code></pre>
  
  <p><strong>Now I want to add child node to the selected node in combobox.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ZnVrU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZnVrU.jpg" alt="enter image description here"></a></p>
  
  <p>When I add child for root node - 2 it goes at the bottom, as displayed in the picture above.</p>
  
  <pre><code> private void AddChildNodeButton_Click(object sender, EventArgs e)
      {
          treeView1.Nodes.Add(comboBox1.Text, textBox1.Text);
      }
  </code></pre>