コード例 #1
0
 public void OpenChildForm(Form childForm)
 {
     if (activeForm != null)
     {
         activeForm.Close();
     }
     activeForm                = childForm;
     childForm.TopLevel        = false;
     childForm.FormBorderStyle = FormBorderStyle.None;
     childForm.WindowState     = FormWindowState.Maximized;
     childForm.Dock            = DockStyle.Fill;
     MainPanel.Controls.Add(childForm);
     MainPanel.Tag = childForm;
     childForm.Show();
     NuevoBtn.BringToFront();
     BackBtn.BringToFront();
 }
コード例 #2
0
        private void MaxBtn_Click(object sender, EventArgs e)
        {
            if (WindowState == FormWindowState.Normal)
            {
                WindowState = FormWindowState.Maximized;
                if (activeForm != null)
                {
                    activeForm.WindowState = FormWindowState.Normal;
                }
                NuevoBtn.BringToFront();
                BackBtn.BringToFront();
            }
            else if (WindowState == FormWindowState.Maximized)
            {
                WindowState = FormWindowState.Normal;
                if (activeForm != null)
                {
                    activeForm.WindowState = FormWindowState.Normal;
                }

                NuevoBtn.BringToFront();
                BackBtn.BringToFront();
            }
        }