title: c# How to Detect Opened Forms
body: <p>I'am trying to detect opened forms in C# with this code;</p>
  
  <pre><code>if ((Application.OpenForms["Form1"] as Form1) != null)
  {
      Application.OpenForms["Form1"].Close();
  }
  </code></pre>
  
  <p>But my form has <code>ShowInTaskBar = false</code> and my code does not work.</p>
  
  <p>How can I detect opened or closed forms if the form has property <code>ShowInTaskBar = false</code>?</p>