private void Settings_FormClosing(object sender, FormClosingEventArgs e) { if (stCurrent.HasSettingChanged()) { if (xMessage.ShowQuestion("Are you sure you want to exit without saving?") == DialogResult.No) { e.Cancel = true; } } else { DialogResult = DialogResult.Yes; } }