WPF MessageBox默认为取消 [英] WPF MessageBox Default To Cancel

查看:209
本文介绍了WPF MessageBox默认为取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此默认值是OK.我可以设置默认的取消"吗?

With this the default is OK. Can I make the default Cancel?

   MessageBoxResult result = MessageBox.Show
      (message, caption, MessageBoxButton.OKCancel);

推荐答案

使用此重载 ,它允许您指定默认的 MessageBoxResult :

Use this overload, which allows you to specify the default MessageBoxResult:

MessageBoxResult result = MessageBox.Show
    (message, caption, MessageBoxButton.OKCancel,  
        MessageBoxImage.Information, MessageBoxResult.Cancel);

这篇关于WPF MessageBox默认为取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆