Skip to content

Commit 43bdce4

Browse files
R3FR4GR3FR4G
authored andcommitted
Now cancels if clicking on the "X"
1 parent 258c7dc commit 43bdce4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Text-File-Displayer/Project1/Program.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,12 @@ static void MenuIO_Options(object sender, EventArgs e)
434434
{
435435
previousFileName = fileName;
436436
Thread.CurrentThread.IsBackground = true;
437-
IOForm.ShowDialog();
437+
if (IOForm.ShowDialog() == DialogResult.OK)
438+
{
439+
OkIO(null, null);
440+
return;
441+
}
442+
CancelIO(null, null);
438443
}
439444
static void MenuSave()
440445
{
@@ -656,7 +661,11 @@ static void MenuEdit_L(object sender, EventArgs e)
656661
resetOutlineMenu();
657662
updateGradientSettings();
658663
updateLocationSettings();
659-
EditForm.ShowDialog();
664+
if(EditForm.ShowDialog() == DialogResult.OK)
665+
{
666+
return;
667+
}
668+
CancelEdit(null, null);
660669
}
661670
static void AddConstantLabel(string text, System.Drawing.Point location, Form form)
662671
{

0 commit comments

Comments
 (0)