网站用JS实现在确认对话框,在WPF中:
MessageBoxResult key = MessageBox.Show("提问文字内容?", "对话框左上角的标题", MessageBoxButton.YesNo, MessageBoxImage.Question,MessageBoxResult.No); if (key != MessageBoxResult.No) { //确认后所执行的语句 }