Ejemplo n.º 1
0
        public void AbrirFormulario <MyForm>() where MyForm : Form, new()
        {
            Form formulario;

            formulario = sectionMain.Controls.OfType <MyForm>().FirstOrDefault();
            if (formulario == null)
            {
                formulario                 = new MyForm();
                formulario.TopLevel        = false;
                formulario.FormBorderStyle = FormBorderStyle.None;
                formulario.Dock            = DockStyle.Fill;
                sectionMain.Controls.Add(formulario);
                sectionMain.Tag = formulario;
                formulario.Show();
                formulario.BringToFront();
            }
            else
            {
                formulario.BringToFront();
            }
        }
Ejemplo n.º 2
0
        public void AbrirFormulario <MyForm>() where MyForm : Form, new()
        {
            Form frm;

            frm = pConteudo.Controls.OfType <MyForm>().FirstOrDefault();
            if (frm == null)
            {
                frm                 = new MyForm();
                frm.TopLevel        = false;
                frm.FormBorderStyle = FormBorderStyle.None;
                frm.Dock            = DockStyle.Fill;
                pConteudo.Controls.Add(frm);
                pConteudo.Tag = frm;
                frm.Show();
                frm.BringToFront();
            }
            else
            {
                frm.BringToFront();
            }
        }
Ejemplo n.º 3
0
        private void OpenForm <MyForm>() where MyForm : Form, new()
        {
            Form formulario;

            formulario = panelCentral.Controls.OfType <MyForm>().FirstOrDefault();
            if (formulario == null)
            {
                formulario                 = new MyForm();
                formulario.TopLevel        = false;
                formulario.FormBorderStyle = FormBorderStyle.None;
                formulario.Dock            = DockStyle.Fill;
                panelCentral.Controls.Add(formulario);
                panelCentral.Tag = formulario;
                formulario.Show();
                formulario.BringToFront();
            }
            else
            {
                formulario.BringToFront();
            }
        }
Ejemplo n.º 4
0
        private void OpenForm <MyForm>() where MyForm : Form, new()
        {
            Form form;

            form = panelALLMYNOTES.Controls.OfType <MyForm>().FirstOrDefault();

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

            form          = new MyForm();
            form.TopLevel = false;

            panelALLMYNOTES.Controls.Add(form);
            panelALLMYNOTES.Tag = form;

            form.Dock = DockStyle.Fill;

            form.BringToFront();
            form.Show();
        }