private void cerrarSesionToolStripMenuItem_Click(object sender, EventArgs e) { List <Form> lst = new List <Form>(); try { for (int i1 = 0; i1 < Application.OpenForms.Count; i1++) { Form f = Application.OpenForms[i1]; if (f.IsMdiChild) { lst.Add(f); } } } catch (IndexOutOfRangeException) { //This can change if they close/open a form while code is running. Just throw it away } while (lst.Count > 0) { Form f = lst[0]; f.Close(); f.Dispose(); lst.RemoveAt(0); } menuStrip1.Enabled = false; controlDeUsuariosToolStripMenuItem.Visible = false; InicioDeSesion iniciodesesion = new InicioDeSesion(); iniciodesesion.MdiParent = this; iniciodesesion.Show(); }
private void Bienvenida_Load(object sender, EventArgs e) { InicioDeSesion inicio = new InicioDeSesion(); inicio.MdiParent = Sistema_Caritas.Bienvenida.ActiveForm; inicio.Show(); }
private void cerrarSesionToolStripMenuItem_Click(object sender, EventArgs e) { List<Form> lst = new List<Form>(); try { for (int i1 = 0; i1 < Application.OpenForms.Count; i1++) { Form f = Application.OpenForms[i1]; if (f.IsMdiChild) lst.Add(f); } } catch (IndexOutOfRangeException) { //This can change if they close/open a form while code is running. Just throw it away } while (lst.Count > 0) { Form f = lst[0]; f.Close(); f.Dispose(); lst.RemoveAt(0); } menuStrip1.Enabled = false; controlDeUsuariosToolStripMenuItem.Visible = false; InicioDeSesion iniciodesesion = new InicioDeSesion(); iniciodesesion.MdiParent = this; iniciodesesion.Show(); }