Esempio n. 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;
            }
        }
Esempio n. 2
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     CloseForm();
     this.IsMdiContainer          = true;
     m_QueryCompanyForm           = new QueryCompanyForm(); //实例化子窗体
     m_QueryCompanyForm.MdiParent = this;                   //设置窗体的父子关系
     m_QueryCompanyForm.Parent    = plContainer;            //设置子窗体的容器为父窗体中的Panel
     m_QueryCompanyForm.Dock      = DockStyle.Fill;
     m_QueryCompanyForm.Show();                             //显示子窗体,此句很重要,否则子窗体不会显示
 }