private void ATMLOptionsForm_FormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.OK) { SaveContext(); } }