public static TransactionHistory CreateForm() // create public static method with form type return { if (instance == null) { instance = new TransactionHistory(); } return(instance); }
private void TransactionHistoryForm_FormClosing(object sender, FormClosingEventArgs e) { instance = null; // explicitly set form instance to null as form closes }
private void buttonTransactionHistory_Click(object sender, EventArgs e) { history = TransactionHistory.CreateForm(); updateHistoryDisplay(); history.Show(); }