private void addNewQuote_Click(object sender, EventArgs e) { if ((Application.OpenForms["AddQuote"] as AddQuote) != null) { // If form exists, bring to front addQuoteForm = Application.OpenForms.OfType <AddQuote>().LastOrDefault(); addQuoteForm.WindowState = FormWindowState.Normal; addQuoteForm.Focus(); } else { // If form does not exist, create it addQuoteForm = new AddQuote(ref savedQuotesFile, ref shippingCostsFile); addQuoteForm.Show(); } }