Windows application not closing

  • Thread starter Thread starter emr
  • Start date Start date
E

emr

Hi, after pressing the close button of the form, it disseapers but when i
look in task manager its still there. Any ideas? Thanks
 
Do you have a long processing loop that you call Application.DoEvents in?
I've made this mistake in the past. What I've done is in the form's close is
set a flag that the form is closing and break out of the loop when the flag
is true.

--
Thanks
Wayne Sepega
Jacksonville, Fl

Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
Hi,

Are you using threads ?

if so mark them as background using Thread.IsBackground = true;

cheers,
 
yes wayne, i ve a long process i call Application.Doevents() and if i dont
run that process no problems.
can u give me an example?
 
Form Load
closing = false;

Form Close
closing = true;

Long process
for (int i = 1; i >0; i++)
{
if (closing)
break;
do your process here;
Application.DoEvents();
}

Not actual running code but should be enough to get you started.

--
Thanks
Wayne Sepega
Jacksonville, Fl

Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
Back
Top