title: Parent's name of Form.show()
body: <p>I use <code>Form.Show()</code> to open a new form</p>
  
  <p>Like this:</p>
  
  <pre><code>public Form2()
  {
      Form1 fm = new Form1();
      fm.Show();
  }
  </code></pre>
  
  <p>How do I get <code>Form2</code>'s name when <code>Form1</code> has control?</p>
  
  <p>What I am doing is create a <code>public variable(ex.pFormname)</code> in <code>From1</code></p>
  
  <p>and set <code>pFormname = Form2</code> before the show common like this:</p>
  
  <pre><code>public Form2()
  {
      Form1.pFormname = "Form2";
      Form1 fm = new Form1();
      fm.Show();
  }
  </code></pre>
  
  <p><em>Is there any other way except creating a public variable?</em></p>
  
  <p>And is there any resource release should I do after closing <code>Form1</code>?</p>