C# - Form.Show locks up the application on the 3rd attempt - why?
<p>So I have a a button that simply shows and hides a window, pretty straightforward.</p>

<p>As such:</p>

<pre><code>public static void LaunchUI()
{

    if (!Forms.AllForms.UI.Visible)
    {
        Forms.AllForms.UI.MdiParent = MyApp.Forms.AllForms.MainForm;
        Forms.AllForms.UI.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        Forms.AllForms.UI.Show();
    }
}


public static void CloseUI()
{
    if (Forms.AllForms.UI.Visible)
        Forms.AllForms.UI.Hide();
}
</code></pre>

<p>I can open and close the window twice, then, on the 3rd time, it locks up on Forms.AllForms.UI.Show().  I have 0 idea why, it is being opened from the main thread.</p>

<p>Anyone know what I'm doing wrong?</p>

<p>Thanks!</p>
