title: how to call a windows form's function from another windows form's event?
body: <p>I am developing a windows based application in .net.</p>
  
  <p>I have two forms. Form2 is instantiated and displayed when an event occurs in form1.</p>
  
  <pre><code>public partial class Form1 : Form
  {
      ...
      private void button1_Click(object sender, EventArgs e)
      {
         .... 
      }
      public void button2_Click(object sender, EventArgs e)   
      {
        Form2.parent = this;
  
        Form2 f2 = new Form2();
  
        f2.show();
      }
  
  }
  
  public partial class Form2 : Form
  {
      ...
      public static Form parent;
      private void button3_Click(object sender, EventArgs e)
      {
         .... //want to call Form1's button1_Click() function.
      }
  
  }
  </code></pre>
  
  <p>Now in Form2's button3_Click() function I want to call Form1's button1_Click() method.</p>
  
  <p>I tried</p>
  
  <pre><code>parent.button1_Click(button3,null);
  </code></pre>
  
  <p>but this is not working.</p>
  
  <p>please help!</p>