WPF MessageBox Default To Cancel

后端 未结 1 1624
心在旅途
心在旅途 2021-01-04 05:07

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

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


        
1条回答
  •  有刺的猬
    2021-01-04 05:32

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

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

    0 讨论(0)
提交回复
热议问题