private void settingsBtn_Click(object sender, EventArgs e) { // check if settings form is already there if (_settingsForm == null) { _settingsForm = new SettingsForm(); _settingsForm.FormClosed += SettingsFormClosed; } _settingsForm.ShowDialog(this); }
void SettingsFormClosed(object sender, FormClosedEventArgs e) { _settingsForm = null; }