Fixed bug when closing window and saving file

This commit is contained in:
Sigmanor 2016-01-25 13:43:56 +02:00
parent 88863ac8a9
commit a44fb626d7

View file

@ -282,14 +282,14 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
{ {
SaveFile.FileName = noname; SaveFile.FileName = noname;
saveAsToolStripMenuItem_Click(this, new EventArgs()); saveAsToolStripMenuItem_Click(this, new EventArgs());
e.Cancel = true;
} }
if (filename != noname) if (filename != noname)
{ {
saveToolStripMenuItem1_Click_1(this, new EventArgs()); saveToolStripMenuItem1_Click_1(this, new EventArgs());
Environment.Exit(0);
} }
e.Cancel = true;
} }
if (res == DialogResult.No) if (res == DialogResult.No)
@ -690,9 +690,7 @@ private void MainWindow_Activated(object sender, EventArgs e)
if (keyChanged == true) if (keyChanged == true)
{ {
//toolStripStatusLabel1.Text = "Key was changed"; customRTB.Modified = true;
//await Task.Delay(4000);
//toolStripStatusLabel1.Text = "Ready";
} }
if (key == "") if (key == "")
@ -1023,6 +1021,5 @@ private void customRTB_KeyDown(object sender, KeyEventArgs e)
{ {
caretPos = customRTB.SelectionStart; caretPos = customRTB.SelectionStart;
} }
} }
} }