private void PNL_Ventanas_Resize(object sender, EventArgs e) { try { ventanas = PNL_Ventanas.MdiForm.MdiChildren.Count(); if (ventanas != 0) { if (WindowState == FormWindowState.Maximized) { for (int i = 0; i < ventanas; i++) { PNL_Ventanas.MdiForm.MdiChildren[i].SetDesktopLocation(78, 28); } } if (WindowState == FormWindowState.Normal) { for (int i = 0; i < ventanas; i++) { PNL_Ventanas.MdiForm.MdiChildren[i].SetDesktopLocation(14, 8); } } } PNL_Ventanas.Refresh(); } catch (Exception ex) { Glo.Mensajes(10, ex.Message); } }
private void BTN_Empleados_Click(object sender, EventArgs e) { try { var form = Application.OpenForms.OfType <WIN_CAT_Usuarios_T>().FirstOrDefault(); WIN_CAT_Usuarios_T frm = form ?? new WIN_CAT_Usuarios_T(); frm.MdiParent = PNL_Ventanas.MdiForm; frm.Show(); frm.Focus(); PNL_Ventanas.Refresh(); } catch (Exception ex) { Glo.Mensajes(10, ex.Message); } }
private void BTN_Salir_Click(object sender, EventArgs e) { ventanas = PNL_Ventanas.MdiForm.MdiChildren.Count(); if (ventanas != 0) { for (int i = ventanas - 1; i > -1; i--) { PNL_Ventanas.MdiForm.MdiChildren[i].Close(); } } PNL_Ventanas.Refresh(); Settings.Default.TipoUsuario = 0; Settings.Default.NombreUsuario = ""; WIN_GLO_Login Login = new WIN_GLO_Login(); Login.Show(); this.Close(); }