Tuesday, July 28, 2009

What is the code to make the whole program close in C#?

I know in Visual Basic.Net, I would use me.close() the close the whole program. How do I do this in C#? Now, I have a messagebox and when the user clicks cancel it just goes back to the form. I want it so that when they hit cancel it will just close the whole program.

What is the code to make the whole program close in C#?
I think you could use Environment.Exit(0) to kill the program.
Reply:I am recalling on top of my head on this one since my iPaq is not in my hand: System.Exit() to punch out the whole program, MessageBox.Show() returns the button enum or ID being pressed.

marigold

No comments:

Post a Comment