Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            login = new Login();

            //panel挂载loginform
            login.TopLevel = false;
            login.FormBorderStyle = FormBorderStyle.None;
            panel1.Controls.Add(login);

            login.Show();
        }
Exemplo n.º 2
0
        public void ReloadLogin(Control mainInterface)
        {
            //移除主界面
            this.panel1.Controls.Remove(mainInterface);
            login = new Login();

            //取消作为顶级控件
            login.TopLevel = false;

            //去掉外边框
            login.FormBorderStyle = FormBorderStyle.None;

            panel1.Controls.Add(login);
            login.Show();
        }