private void closeChildToolStripMenuItem_Click(object sender, EventArgs e) { try { bool openOMList = Class.clsGlobal.CheckOpened("frmOMList"); //To Close Active Child Form if (openOMList == true) { if (this.ActiveMdiChild.Name == "frmOMList") { frmOMList _objOmList = (frmOMList)this.ActiveMdiChild; _objOmList.Close(); } } //else //{ // closeChildToolStripMenuItem.Enabled = false; //} } catch (Exception ex) { throw ex; } }
private void operationMasterListToolStripMenuItem_Click(object sender, EventArgs e) { frmOMList objOmList = new frmOMList(); objOmList.MdiParent = this; objOmList.WindowState = FormWindowState.Maximized; objOmList.Show(); }
public static frmOMList GetChildInstance() { if (m_OMList == null) //if not created yet, Create an instance { m_OMList = new frmOMList(); } return(m_OMList); //just created or created earlier.Return it }
private void importListToolStripMenuItem_Click(object sender, EventArgs e) { MemberBussiness _bll = new MemberBussiness(); frmOMList frmOMList = new frmOMList(); OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string filePath = openFileDialog.FileName; string fileName = System.IO.Path.GetFileNameWithoutExtension(openFileDialog.FileName); //frmOMList.dgvMember.DataSource = _bll.GetMemberExcel(filePath, fileName); frmOMList.excelMemModel = _bll.GetMemberExcel(filePath, fileName); frmOMList.MdiParent = this; frmOMList.WindowState = FormWindowState.Maximized; frmOMList.dgvMember.MaximumSize = MaximumSize; frmOMList.Show(); } }