I am experiencing strange behavior using MessageBox (es) in a C # / WPF program.
Create a basic WPF application with a few labels and a button on it.
Here is the button code
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBoxResult result;
do
{
result = MessageBox.Show(this, "Please Click here under", "TestBugMessageBox", MessageBoxButton.OKCancel, MessageBoxImage.Information, MessageBoxResult.None);
if (result.Equals(MessageBoxResult.OK))
{
result = MessageBox.Show(this, "Is it the first time you see it ?", "TestBugMessageBox", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.None);
}
} while (result.Equals(MessageBoxResult.Yes));
}
Then place the windows in the center of the screen (so that the MessageBox can cover some labels)
Click "Yes" three times, and no for the last time, and you will see the problem (hopefully):
A message box is displayed in the message box.
Could you tell me what is wrong with him?
source
share