private void sizeToolStripMenuItem1_Click(object sender, EventArgs e) { try { AddNewSize ARF = null; if (IsFormAlreadyOpen(typeof(AddNewSize)) == null) { ARF = new AddNewSize(); ARF.MdiParent = this; ARF.Show(); } else { Form selectedForm = IsFormAlreadyOpen(typeof(AddNewSize)); foreach (Form OpenForm in this.MdiChildren) { if (OpenForm == selectedForm) { if (selectedForm.WindowState == FormWindowState.Minimized) { selectedForm.WindowState = FormWindowState.Normal; } selectedForm.Select(); } } } } catch (Exception x) { MessageBox.Show(x.GetBaseException().ToString()); } }