You can create a method in the class game1
public void Quit() { this.Exit(); }
Now in another class that you want to exit, you can add a link to your main class
public class SomeOtherClassYouWantToExitFrom { public Game1 game;
When you create the SomeOtherClassYouWantToExitFrom class, you need to set the game object as an instance of Game1. You can also pass it as an argument to constuctor
Blah = new SomeOtherClassYouWantToExitFrom(...) { game = this };
Using the Exit method is great for me, I'm not sure why Visual Studio thinks it is still debugging.
Cyral source share