private void button2_Click(object sender, EventArgs e) { if (agregarCita == null) { agregarCita = new AgregarCita(); agregarCita.Show(); agregarCita.FormClosed += instanceHasBeenClosed; } else { agregarCita.Focus(); } }
private void instanceHasBeenClosed(object sender, FormClosedEventArgs e) { agregarCita = null; }