I am working on c# desktop application, In MDI form the same child window getting opened when you click on menu, while first instance of that window is present. How can I preven
Maybe this can help you:
public static bool formOpened = false; // it is global boolean
Form2 instance;
When you open your form:
if(formOpened == false)
{
instance = new Form2();
instance.Show();
formOpened = true;
}
else
{
instance.Focus();
}
One more thing is after your Form2 is been closed, you should set the value of formOpened to false;