jeudi 29 janvier 2015

How I can close XNA application before the Form? C#


Vote count:

0




I'm doing XNA application.I use Gam1.cs (XNA file) and MainForm.cs (form file)


Program.cs



MainForm mainForm = new MainForm();
mainForm.Show();

Game1 game = new Game1(mainForm);
game.Run();


When "X" button is clicked I try to close all application in MainForm.cs



private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}


Unfortunally, Game1.cs is working all time.


How Can I close Game1 by pressing X Button?



asked 1 min ago







How I can close XNA application before the Form? C#

Aucun commentaire:

Enregistrer un commentaire