I'm new for C#. My MDI application has some children forms. these forms need to visible and load time to time. when I load a children form second time by using Show(), the above exception is coming. when I load a form first time I use Close() to close the loaded form. Buttons are in MDI form.Please help to solve this issue.
My some code snippet is bellow,
Form closingForm = new Form();
private void button1_Click(object sender, EventArgs e)
{
closingForm.Close();
closingForm = form1;
closingForm.Show();
}
private void button2_Click(object sender, EventArgs e)
{
closingForm.Close();
closingForm = form2;
closingForm.Show();
}