private void ShowLogsForm() { if (_exampleForm == null) { _exampleForm = new ExamepleForm(); _exampleForm.Closed += logsForm_Closed; // avoid reshowing a disposed form _exampleForm.Show(); } else { _exampleForm.Activate(); } }
// null out the forms so we know to create a new one. private void logsForm_Closed(object sender, EventArgs e) { _exampleForm = null; }