Skip to content

Commit cf1ddc4

Browse files
committed
Add escape button cancellation to About and FindSymbol dialogs.
1 parent 8432db7 commit cf1ddc4

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

RetailCoder.VBE/UI/About/AboutDialog.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,19 @@ private AboutControlViewModel ViewModel
2121
AboutControl.DataContext = _viewModel;
2222
}
2323
}
24+
25+
private void AboutDialog_Load(object sender, System.EventArgs e)
26+
{
27+
28+
}
29+
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
30+
{
31+
if (keyData == Keys.Escape)
32+
{
33+
this.Close();
34+
return true;
35+
}
36+
return base.ProcessCmdKey(ref msg, keyData);
37+
}
2438
}
2539
}

RetailCoder.VBE/UI/FindSymbol/FindSymbolDialog.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,15 @@ public FindSymbolDialog()
2929

3030
Text = string.Format("Rubberduck - {0}", RubberduckUI.FindSymbolDialog_Caption);
3131
}
32+
33+
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
34+
{
35+
if (keyData == Keys.Escape)
36+
{
37+
Close();
38+
return true;
39+
}
40+
return base.ProcessCmdKey(ref msg, keyData);
41+
}
3242
}
3343
}

0 commit comments

Comments
 (0)