Use the below code its for Form2 to be open and others should be closed
add namespace using system.Reflection;
private void level1ToolStripMenuItem_Click(object sender, EventArgs e)
{
Assembly frmAssembly = Assembly.LoadFile(Application.ExecutablePath);
foreach (Type type in frmAssembly.GetTypes())
{
if (type.BaseType == typeof(Form))
{
if (type.Name == "Form2")
{
Form frmShow = (Form)frmAssembly.CreateInstance(type.ToString());
foreach (Form form in this.MdiChildren)
{
form.Close();
}
frmShow.MdiParent = this;
frmShow.StartPosition = FormStartPosition.CenterScreen;
frmShow.Show();
}
}
}
}