NOTICE: Our Community is moving. Get more information.
Customer is developing a WPF application and would like to display a Windows Message Box that has a Yes and No button. How can the application tell which one of these buttons was pressed after returning?
The Message Box is being displayed as follows:
invoke type System.Windows.MessageBox::Show("My Text", "My Caption", type System.Windows.MessageBoxButton::YesNo, type System.Windows.MessageBoxImage::Question, type System.Windows.MessageBoxResult::Yes, type System.Windows.MessageBoxOptions::RightAlign)
The result is returned from the Show method as type System.Windows.MessageBoxResult so you can just test for the result directly in a conditional statement like:
evaluate type System.Windows.MessageBox::Show(
when type MessageBoxResult::Yes
when type MessageBoxResult::No