private void refreshFormVars(object sender, EventArgs e) { if ((Form)sender == myTicketListForm) { myTicketListForm = null; } else if ((Form)sender == myExpiredFormularListForm) { myExpiredFormularListForm = null; } }
private void buttonOpenTicketList_Click(object sender, EventArgs e) { if (myTicketListForm == null) { myTicketListForm = new TicketListForm(linkedModel); myTicketListForm.Show(); myTicketListForm.FormClosing += refreshFormVars; } else { myTicketListForm.BringToFront(); } }