title: VB.Net 2008 "InvalidOperationException was unhandled" when trying to show or hide forms
body: <p>I have multiple forms in my program. The menu form (frmMenu) contains buttons that will hide the menu form and show their corresponding form e.g. form frmXyl. Closing the form frmXyl should hide it and show the form frmMenu.</p>
  
  <p>'Form frmMenu button click event  </p>
  
  <pre><code>    'Hide the form frmMenu
       Me.Hide()
      'Show the form frmXyl
       frmXyl.Show()
  </code></pre>
  
  <p>'This is the form frmXyl form closing event</p>
  
  <pre><code>    'Hide the form frmXyl
      Me.Hide()
      'Show the form frmMenu
      frmMenu.Show()
  </code></pre>
  
  <p>I can start the program and click on the button to hide frmMenu and show frmXyl, then I can close frmXyl which hides frmXyl and show frmMenu. </p>
  
  <p>Now, if I click the button to show frmXyl and hide frmMenu a <strong>second time</strong> I get an error.</p>
  
  <p>Here is the error: An error occurred creating the form. See Exception.InnerException for details.  The error is: COM object that has been separated from its underlying RCW cannot be used.</p>
  
  <p>I have used show and hide with forms before without issue, thanks in advance of any solution you may have to this. </p>