private void inventoryToolStripMenuItem_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <formInventory>().Count() == 0) { frmInventory = new formInventory(); frmInventory.MdiParent = this; frmInventory.Dock = DockStyle.Fill; frmInventory.Show(); frmInventory.BringToFront(); frmInventory.WindowState = FormWindowState.Minimized; frmInventory.WindowState = FormWindowState.Maximized; } else { reopenTheForm(typeof(formInventory)); } }
private void btnInventoryItems_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <formInventory>().Count() == 0) { frmInventory = new formInventory(); // Set the Parent Form of the Child window. frmInventory.MdiParent = MdiParent; // Fill the parent form and bring it to front. frmInventory.Dock = DockStyle.Fill; // Display the new form and maximize to fill the parent MDI. frmInventory.Show(); frmInventory.BringToFront(); frmInventory.WindowState = FormWindowState.Minimized; frmInventory.WindowState = FormWindowState.Maximized; } else { formBERP.reopenTheForm(typeof(formInventory)); } }