Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello, i am quite new on coding, especially on GUI applications, i have developed a game and i cant make the restart button of the game work correctly, i have used the Application.Restart method bt it restarts the whole application, cant i specify where i want the code to execute?
or other alternatives..
Posted
Updated 1-Sep-11 4:27am
v2

Application.Restart is working as it should.

It always terminates the current instance of the Applicaion and starts the new instance. - Application.Restart Method


You should write your own custom code for "Restart" feature of your Game. You may write a Method - "RestartGame" in which clear/dispose all the current used objects, Reinitialize all the objects/variables required for New-Game.
 
Share this answer
 
You're doing it wrong.

I know, my answer might seem vague, or even obtuse, but the quality of the question dictates the quality of the answer. Hint - we need more info.
 
Share this answer
 
In any application should have the entry point for example, Main method in C# windows application. In that method we could put application start up code, for example, call OpenCalculator() method to start the calculator. So if you a restart button, from the restart button call the OpenCalculator method to restart the Calculator.

:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900