title: Call method of specific MDI child from parent
body: <p>I have a MDI parent window that can contain mulitple instances of a particular child from, call it <strong>frmChild</strong>. Now when a particular control is clicked from the parent, I need to get the active frmChild and <strong>invoke a particular method from frmChild</strong></p>
  <p>Below is an image of what I am trying to achieve (get active MDI child and invoke a particular method from that class):</p>
  <p><a href="https://i.stack.imgur.com/bh3Ag.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bh3Ag.jpg" alt="a busy cat" /></a></p>
  
  <p>Now each frmChild is instantiated by:</p>
  <pre><code>private void newFileToolStripMenuItem1_Click(object sender, EventArgs e)
      {
          frmNewDocument = new frmNewDocument();
          frmNewDocument.MdiParent = this;
          frmNewDocument.Show();
      }
  </code></pre>
  <p>When I want to invoke a method from the <strong>active frmChild</strong>, I am trying the following and am stuck:</p>
  <pre><code>private void saveFileToolStripMenuItem1_Click(object sender, EventArgs e)
      {
          /* get active MDI child*/
          Form frmActiveNewDocument = this.ActiveMdiChild;           
          
          /* make sure MDI child is a &quot;New Document&quot; type form */
          if (frmActiveNewDocument.GetType() == frmNewDocument.GetType())
          {
              /* invoke a method from active frmChild here */
          }
      }
  </code></pre>
  <p>I am still learning OOP and am sure this is some principle. If that can be mentioned in the article, that would be great also.</p>
  <p>**Note: I read that an interference for frmChild is the best way to approach this issue so the Main form doesn't need to go digging around in each frmChild, so I have created an interface that frmChild uses, which is: **</p>
  <pre><code> public interface NewFileFormInterface
  {
      void saveFile();
  }
  </code></pre>
  <p>Now, <strong>saveFile()</strong> is the  method I want to invoke from Main, which is implemented in frmChild.</p>
  <p>Any help on this issue and some keywords I can research would be great.</p>
  <p>TIA!</p>