void notify_config(object sender, EventArgs e) { //show the form for settings //prevent user from creating more then one form if (!formPresent) { formPresent = true; form = new Config(); //use close event to reset formpresent boolean form.FormClosed += new FormClosedEventHandler(form_FormClosed); form.Show(); } }
void form_FormClosed(object sender, FormClosedEventArgs e) { formPresent = false; form = null; }