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 !

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

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

!!!!

This article has been dead for over six months. Start a new discussion instead.