public static FRM_Consulta Instance() { if (instance == null) { instance = new FRM_Consulta(); } return(instance); }
private void mConsulta_Click_1(object sender, EventArgs e) { for (int intIndex = Application.OpenForms.Count - 1; intIndex > 0; intIndex--) { if (Application.OpenForms[intIndex] != this) { Application.OpenForms[intIndex].Close(); } } FRM_Consulta form_consulta = FRM_Consulta.Instance(); form_consulta.MdiParent = this; form_consulta.Show(); }
private void FRM_Consulta_FormClosed(object sender, FormClosedEventArgs e) { instance = null; }