Missing default cancel button on OK only ArcGIS.Desktop.Framework.Dialogs.MessageBox

1453
4
Jump to solution
03-10-2021 01:14 PM
Justin_ODell
New Contributor III

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

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi Justin,

This is a bug, and has been reported to the development team. Thanks for reporting this. 

Uma

View solution in original post

0 Kudos
4 Replies
UmaHarano
Esri Regular Contributor

Hi Justin,

This is a bug, and has been reported to the development team. Thanks for reporting this. 

Uma

0 Kudos
Justin_ODell
New Contributor III

Uma,

Thanks for confirming!

- Justin

0 Kudos
ghefarm
New Contributor

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


0 Kudos
UmaHarano
Esri Regular Contributor

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)

 

0 Kudos