//Função de Abrir Formulario public void AbrirFormulario <Formulario>() where Formulario : Form, new() { Form FormAux; FormAux = Panel_Content.Controls.OfType <Formulario>().FirstOrDefault(); if (FormAux != null) { FormAux.Close(); } FormAux = new Formulario { TopLevel = false }; Panel_Content.Controls.Add(FormAux); Panel_Content.Tag = FormAux; FormAux.Show(); FormAux.BringToFront(); }
//Função de Abrir Formulario public void AbrirFormulario <Formulario>() where Formulario : Form, new() { Form FormAux; FormAux = PanelConteudo.Controls.OfType <Formulario>().FirstOrDefault(); if (FormAux == null) { FormAux = new Formulario { TopLevel = false }; PanelConteudo.Controls.Add(FormAux); PanelConteudo.Tag = FormAux; FormAux.Show(); } else { FormAux.Visible = false; FormAux.Visible = true; } FormAux.BringToFront(); }