Similar to https://community.esri.com/t5/arcgis-pro-sdk-questions/messagebox/m-p/826655, minor question about ArcGIS.Desktop.Framework.Dialogs.MessageBox vs. System.Windows.MessageBox :
On the System.Windows.MessageBox the MessageBoxButton.OK option allows the Esc key to Cancel/Close the messagebox.
On the ArcGIS.Desktop.Framework.Dialogs.MessageBox the MessageBoxButton.OK option doesn't do anything when the Esc key is pressed.
Was this accidental (a bug) or intentional?
Just curious. Thanks much!
Running in Pro 2.2.0.4
Solved! Go to Solution.
Hi Justin,
This is a bug, and has been reported to the development team. Thanks for reporting this.
Uma
Hi Justin,
This is a bug, and has been reported to the development team. Thanks for reporting this.
Uma
Uma,
Thanks for confirming!
- Justin
The defaultMessageResult didn't worked for me. It is always OK!
I tried it with both Cancel and None:
Arc.MessageBox.Show("msg", "Title",MessageBoxButton.OK, someIcon, MessageBoxResult.Cancel/None)
Is this the same bug?
Running Pro 2.7.2
You have to display the cancel button in order to get the Cancel result.
var results = MessageBox.Show("msg", "Title",
System.Windows.MessageBoxButton.OKCancel,
System.Windows.MessageBoxImage.Information)