title: TreeView nodes from other form
body: <p>I have a TreeView with dinamically created nodes.</p>
  
  <p>I want to reach the nodes from other form, when i close the other form.</p>
  
  <p>But it does not work.</p>
  
  <p>Sample:</p>
  
  <p>form1</p>
  
  <pre><code>//show the other form (form2)
  private void button1_Click(object sender, EventArgs e)
      {
          using (Form1 form1 = new Form1())
          {
              using (Form2 form2 = new Form2(form1))
              {
                  form2.StartPosition = FormStartPosition.CenterParent;
                  form2.ShowDialog();
              }
          }
      }
  
      //call this method from other form (form2) when close
      internal void example()
      {
          MessageBox.Show(treeView1.Nodes.Count.ToString());
      }
  
      //create the nodes
      private void Form1_Load(object sender, EventArgs e)
      {
          TreeNode node = new TreeNode("aaaa");
          treeView1.Nodes.Add(node);
          node = new TreeNode("bbbb");
          treeView1.Nodes.Add(node);
          node = new TreeNode("cccc");
          treeView1.Nodes.Add(node);
      }
  </code></pre>
  
  <p>form2</p>
  
  <pre><code>public partial class Form2 : Form
  {
      Form1 form1;
  
      public Form2(Form1 form1)
      {
          InitializeComponent();
  
          this.form1 = form1;
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          this.Close();
          form1.example();
      }
  }
  </code></pre>
  
  <p>MessageBox.Show(treeView1.Nodes.Count.ToString());</p>
  
  <p>result: 0</p>