summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-10-27 16:28:56 +0100
committeremkael <emkael@tlen.pl>2019-10-27 16:28:56 +0100
commitb6822ca445074d0d7e9dfa30e0d65b86e7c30331 (patch)
tree144b94b52cdbf42a4b647ba15591f893020ab4cc
parent0bbfdfd58fe58cb46d3cef52f3f3e9439fe7f49b (diff)
In continuous mode, ask on exit (and minimize to tray according to the answer)
-rw-r--r--spedytor/Form1.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/spedytor/Form1.cs b/spedytor/Form1.cs
index ac9cb43..91f6ebe 100644
--- a/spedytor/Form1.cs
+++ b/spedytor/Form1.cs
@@ -262,7 +262,23 @@ namespace spedytor
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
- this.minimizeToTray();
+ if (this.tInterval.Enabled)
+ {
+ DialogResult dr = MessageBox.Show("Spedytor jest w trybie pracy ciągłej.\nCzy chcesz zakończyć działanie programu?", "Spedytor - wyjście", MessageBoxButtons.YesNoCancel);
+ switch (dr)
+ {
+ case DialogResult.Yes:
+ this.bExit_Click(null, null);
+ break;
+ case DialogResult.No:
+ this.minimizeToTray();
+ break;
+ }
+ }
+ else
+ {
+ this.bExit_Click(null, null);
+ }
}
private void closeMenuItem_Click(object sender, EventArgs e)