diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index c084b5149..510d14b89 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -159,12 +159,19 @@ namespace Flow.Launcher private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { - if (_button == MessageBoxButton.YesNo) - return; - else if (_button == MessageBoxButton.OK) - _result = MessageBoxResult.OK; - else - _result = MessageBoxResult.Cancel; + switch (_button) + { + case MessageBoxButton.OK: + _result = MessageBoxResult.None; + break; + case MessageBoxButton.OKCancel: + case MessageBoxButton.YesNoCancel: + _result = MessageBoxResult.Cancel; + break; + case MessageBoxButton.YesNo: + _result = MessageBoxResult.No; + break; + } DialogResult = false; Close(); }