private void buttonItem3_Click(object sender, EventArgs e) { foreach (Form frm in this.MdiChildren) { if (frm is NPCForm) { frm.Activate(); return; } } NPCForm doc = null; try { doc = new NPCForm(); doc.MdiParent = this; doc.WindowState = FormWindowState.Maximized; doc.Show(); doc.Update(); } catch { doc.Close(); } }
private void buttonItem3_Click(object sender, EventArgs e) { foreach (Form frm in this.MdiChildren) { if (frm is NPCForm) { frm.Activate(); return; } } NPCForm doc = new NPCForm(); doc.MdiParent = this; doc.WindowState = FormWindowState.Maximized; doc.Show(); doc.Update(); }