Ejemplo n.º 1
0
 private void ShowChildForm(Form senderForm)
 {
     if (senderForm == null)
     {
         return;
     }
     HideChildForm();
     currentChildForm = senderForm as CustomForm;
     currentChildForm.BringToFront();
     currentChildForm.Show();
 }
Ejemplo n.º 2
0
        private void frmFlights_Load(object sender, EventArgs e)
        {
            currentChildForm = new frmFlightsList();

            currentChildForm.TopLevel = false;
            currentChildForm.Dock     = DockStyle.Fill;
            pnDesktop.Controls.Add(currentChildForm);
            currentChildForm.BringToFront();
            currentChildForm.Show();

            btnChuyenBay.Checked = true;
        }
Ejemplo n.º 3
0
 private void ShowChildForm(CustomForm senderForm)
 {
     if (senderForm == null)
     {
         return;
     }
     HideChildForm();
     currentChildForm          = senderForm;
     currentChildForm.TopLevel = false;
     currentChildForm.Dock     = DockStyle.Fill;
     pnDesktop.Controls.Add(currentChildForm);
     currentChildForm.BringToFront();
     currentChildForm.Show();
 }
Ejemplo n.º 4
0
        // End btnReports Handlers

        // Start Miscellaneus Methods
        private void AddWindow <CustomForm>() where CustomForm : Form, new()
        {
            // Busca en los controles del panel windowsContainer el primer control que sea de tipo CustomForm
            Form window = windowsContainer.Controls.OfType <CustomForm>().FirstOrDefault();

            if (window == null)
            {
                window          = new CustomForm();
                window.TopLevel = false;
                window.Dock     = DockStyle.Fill;
                windowsContainer.Controls.Add(window);
                windowsContainer.Tag = window;
                window.Show();
                window.BringToFront();
            }
            else
            {
                window.BringToFront();
            }
        }