Form_Activated is messing up closing the program
<p>I'm currently trying to bring two forms to the front when I activate them from the Task bar or via Alt+Tab. The problem is that I can't close the main form if the second one exists:</p>

<p>This is the code I use</p>

<pre><code>   private void Haupt_Activated(object sender, EventArgs e)
    {
        cardLibrary.Focus(); //Focus the second form
        this.Focus(); //refocus the first one
    }
</code></pre>

<p>What am I doing from?</p>

<p>EDIT: 
Haupt is the main form.
CardLib is variable in Haupt
this is how CardLib is called:</p>

<pre><code>    private void cMenuOpenLibrary_Click(object sender, EventArgs e)
    {
        if (!Config.libOpen)
        {
            if (cardLibrary == null) cardLibrary = new CardLib(this);
            cardLibrary.Show();
            cardLibrary.Left = this.Left - cardLibrary.Width - 5;
            cardLibrary.Top = this.Top;
        }
    }
</code></pre>

<p>EDIT 2: Sry I was being dumb. Adding closing the CardLib via Haupt_FormClosed fixed it.</p>
