ok am new to C# and am doing good so far except I been having a problem with the exit button

the code for the exit button is:

close();

or I use = this.close();

and that close the form but the problem is that the program still in the process in the task manager

I tried ti use Application.exit(); but for some reason when I compile and run with VC++ 2005 I get the error which has break or continue

what am I missing, I did alot of research and thats what a found most of the people are talking about

Thank in-advance !

Recommended Answers

All 7 Replies

this.Close(); and Application.Exit(); both will work. Your problem may be with the C# case sensitivity. For Eg: try this.Close(); instead of this.close() and Application.Exit(); instead of Application.exit();

Sounds like you have either:

some threads still running
the close code isnt effecting the form you thought, or the form you think is the main form isnt.
your forms close is actually preventing it from stopping.

To prove you havent gone nuts, make a new blank app, place a button on a form, in the button put

Close();

and then run it, click on the button.

Close does need a capitial though

Um, they said C# at the top, and this would be the C# forum, so, would seem C#

I tried ti use Application.exit(); but for some reason when I compile and run with VC++ 2005 I get the error which has break or continue

!!!!

who knows, either way, diagnosing the problem works out to be the same.

let me give it a try and see

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.