I have a little problem, but this time it refers to MessageBoxButton.YesNo . This is my problem: I do not know what the correct syntax is, if I press Enter (keyboard) or click "Yes", Application.Exit(); will be executed Application.Exit(); , and if I press Esc (keyboard) or click "No", Application.Exit(); will not be executed. This is my code:
MessageBox.Show("Are you sure you want to exit?","Application Exit", MessageBoxButtons.YesNo); Application.Exit();
source share