tags:

views:

104

answers:

2

Im using System.Windows.MessageBox.Show() to display a dialog to the user. One overload lets me set the buttons that appear using the System.Windows.MessageBoxButton enum. However, it seems to lack a RetryCancel option that my googling suggests it should have.

  • Am I missing something?
  • How do I display a RetryCancel messagebox?
+3  A: 

You aren't missing anything. There's a RetryCancel value:

MessageBox.Show("text", "caption", MessageBoxButtons.RetryCancel);

Remark: Do not mistake with WPF's MessageBoxButton enumeration which doesn't have such value.

Darin Dimitrov
MessageBoxButton **s**... of course, hehe thanks :)
mizipzor
"best overload has invalid arguments", seems to lack the one that accepts **MessageBoxButtons**. Wrong version of the framework?
mizipzor
I don't know which version you are using but the method's definitely there: http://msdn.microsoft.com/en-us/library/0x49kd7z.aspx
Darin Dimitrov
Your remark is correct, I had confused the WPF and the WinForms MessageBox.
mizipzor
+1  A: 

System.Windows is WPF. System.Windows.Forms is WinForms.

John Saunders
Correct, the WinForms MessageBox had more options, one of them was the one I was looking for.
mizipzor