📜  wpf yes no message box exit - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:16.660000             🧑  作者: Mango

代码示例2
var response = MessageBox.Show("Do you really want to exit?", "Exiting...",
                                      MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
            if (response == MessageBoxResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                Environment.Exit(0);
            }