开发者

How to Kill the exe in taskmanager?

开发者 https://www.devze.com 2023-03-26 08:51 出处:网络
I generated the C#-Win App exe using visual studio setup project. After closing the installed app,still process is running in task manager.

I generated the C#-Win App exe using visual studio setup project. After closing the installed app,still process is running in task manager. I tried with Application.Exit() in Dispose() of every form. but while navigating one form to another form i used this.Hide().so each navigation application closing.

i can't u开发者_JAVA百科se MDI concept now..

How to do it?

Please guide me..


In your last form handle the Closing event and then call Envirunment.Exit, it will cause the same effect you want. So:

private void OnFormClosing(object sender, FormClosingEventArgs e)
{
    Environment.Exit(0);
}


in the main form Form_Close event handler you can have Application.ExitThread()


Thanks for your replies

In the each form FormClosed event handler i called the Application.Exit();

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
    Application.Exit();                
}

It's working great..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号