private void btnCloseWindow_Click(object sender, EventArgs e) { if (blnTextChanged) { var response = MessageBox.Show(this, Resources.You_have_unsaved_changes, Resources.Exit_Check, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (response == DialogResult.No) { return; } } ProgSettings.ShowThisForm(ProgSettings.MainForm); Close(); }
private void frmTables_FormClosing(object sender, FormClosingEventArgs e) { // Has any text changed on the form if (blnTextChanged) { // Ask the user if they which to close without saving var response = MessageBox.Show(this, Resources.You_have_unsaved_changes, Resources.Exit_Check, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (response == DialogResult.No) { // Bail out of the form closing e.Cancel = true; return; } } ProgSettings.ShowThisForm(ProgSettings.MainForm); }
private void btnQuit_Click(object sender, EventArgs e) { ProgSettings.ShowThisForm(ProgSettings.MainForm); Close(); }