The defaultResult of MessageBox didn't work for me. It was always 'OK'!
I tried to show a MessageBox with the NONE-Result (or CANCEL) as the defaultRersult:
Arc.MessageBox.Show("msg", "title",MessageBoxButton.OK, someIcon, MessageBoxResult.Cancel/None)
Now even clicking on "X" (up right in the box), the OK was returned!
Running Pro 2.7.2
Solved! Go to Solution.
The ArcGIS Pro API's MesssageBox.Show method returns the same result as the MessageBox method in .Net. According to the .Net documentation these are the results that are returned (depending on the type of MessageBox):
Show returns a MessageBoxResult value that specifies which button on a message box a user clicked. MessageBoxButton specifies which buttons are displayed on a message box.
The result value that is returned from a message box depends on what buttons the message box has and how a user closes a message box:
See: https://docs.microsoft.com/en-us/dotnet/api/system.windows.messageboxresult?view=net-5.0
The ArcGIS Pro API's MesssageBox.Show method returns the same result as the MessageBox method in .Net. According to the .Net documentation these are the results that are returned (depending on the type of MessageBox):
Show returns a MessageBoxResult value that specifies which button on a message box a user clicked. MessageBoxButton specifies which buttons are displayed on a message box.
The result value that is returned from a message box depends on what buttons the message box has and how a user closes a message box:
See: https://docs.microsoft.com/en-us/dotnet/api/system.windows.messageboxresult?view=net-5.0