protected override void OnKeyDown(KeyEventArgs e)
{
// So what we're doing here is testing for any of the find/replace
// command shortcut bindings. If the key combination matches we send
// the KeyEventArgs back to Scintilla so it can be processed. That
// way things like Find Next, Show Replace are all available from
// the dialog using Scintilla's configured Shortcuts
List<KeyBinding> findNextBinding = this.Scintilla.Commands.GetKeyBindings(BindableCommand.FindNext);
List<KeyBinding> findPrevBinding = this.Scintilla.Commands.GetKeyBindings(BindableCommand.FindPrevious);
List<KeyBinding> showFindBinding = this.Scintilla.Commands.GetKeyBindings(BindableCommand.ShowFind);
List<KeyBinding> showReplaceBinding = this.Scintilla.Commands.GetKeyBindings(BindableCommand.ShowReplace);
var kb = new KeyBinding(e.KeyCode, e.Modifiers);
if (findNextBinding.Contains(kb) || findPrevBinding.Contains(kb) || showFindBinding.Contains(kb) || showReplaceBinding.Contains(kb))
{
this.Scintilla.FireKeyDown(e);
}
if (e.KeyCode == Keys.Escape)
Hide();
base.OnKeyDown(e);
}