It’s somewhat easy to find a way to do this in a winforms application, but in XNA I can’t make the code snippets work as intended. I also don’t want to disable the system buttons at all, I still need maximize and minimize buttons.
How do I disable the close button (x) on XNA game form without disabling the other buttons?
Define this in your code
Then use this function to disable or enable the close button