How can I override the close button near minimize/maximize in such a way that the application doesn't automatically close. I want it to show an exit screen or something like this, so I would like to be able to delay the close and display something on the screen when I press the red close button. At first I thought that I should override the OnExiting() method, but I couldn't get it working. This is my first attempt at creating a fully functional game, so I have no previous experience in game development nor with XNA.
As described on the XNA Community Forum, you can get the host
Using that as a template, you should be able to come up with a method for bringing up an in-game dialog. You'll likely need to introduce a variable that indicates whether the user really wants to quit or not. For example: