private void frmAltaAfiliado_FormClosed(object sender, FormClosedEventArgs e) { if (opcionelegida != 3 && opcionelegida != 4) { frmAfiliado abierto = null; FormCollection fc = Application.OpenForms; foreach (Form frm in fc) { if (frm.Name == "frmAfiliado") { abierto = (frmAfiliado)frm; } } if (abierto == null) { frmHomeAfiliado princ = new frmHomeAfiliado(usuario, rol); Hide(); princ.Show(); } else { abierto.Show(); } } }
private void frmAltaAfiliado_Load(object sender, EventArgs e) { dtpFecha.CustomFormat = "yyyy-M-d HH:mm:ss"; dtpFecha.Format = DateTimePickerFormat.Custom; frmHomeAfiliado acerrar = null; FormCollection fc = Application.OpenForms; foreach (Form frm in fc) { if (frm.Name == "frmHomeAfiliado") { acerrar = (frmHomeAfiliado)frm; } } acerrar.Hide(); }
public static void ABMAfiliado(object sender, EventArgs e) { var home = new Abm_Afiliado.frmHomeAfiliado(usuario, rol); home.Show(); }