Example #1
0
        private void CloseForm()
        {
            if (m_QueryCompanyForm != null)
            {
                m_QueryCompanyForm.Close();
                m_QueryCompanyForm = null;
            }

            if (m_QueryEmployeeForm != null)
            {
                m_QueryEmployeeForm.Close();
                m_QueryEmployeeForm = null;
            }

            if (m_AddCompanyForm != null)
            {
                m_AddCompanyForm.Close();
                m_AddCompanyForm = null;
            }

            if (m_AddEmployeeForm != null)
            {
                m_AddEmployeeForm.Close();
                m_AddEmployeeForm = null;
            }

            if (m_AddCompanyListForm != null)
            {
                m_AddCompanyListForm.Close();
                m_AddCompanyListForm = null;
            }
        }
Example #2
0
 private void btnAddCompanyList_Click(object sender, EventArgs e)
 {
     CloseForm();
     this.IsMdiContainer            = true;
     m_AddCompanyListForm           = new AddCompanyListForm(); //实例化子窗体
     m_AddCompanyListForm.MdiParent = this;                     //设置窗体的父子关系
     m_AddCompanyListForm.Parent    = plContainer;              //设置子窗体的容器为父窗体中的Panel
     m_AddCompanyListForm.Dock      = DockStyle.Fill;
     m_AddCompanyListForm.Show();                               //显示子窗体,此句很重要,否则子窗体不会显示
 }