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(); } }
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(); } }
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(); } }
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(); }