关闭表单后进程未关闭 [英] Process does not close after closing the form

查看:39
本文介绍了关闭表单后进程未关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个调用另一个表单然后消失的第一个表单(frm.visible = false).此表单在被调用一次后不应返回,但它是主表单(启动程序时出现的第一个表单).我试图做到这一点,当您关闭第二个表单时,两个表单都关闭,我尝试了多种方法,但所有方法都使该过程处于活动状态.

I have a first form that calls another one and then disappears (frm.visible = false). This form should not come back after being called once, but it's the main form (the first one that appears when you launch the program). I am trying to make it so when you close the second form, both forms close, I have tried multiple things but all of them leave the process active.

这是我使用的代码:

private void frmCreation_FormClosing(object sender, FormClosingEventArgs e)
        {
            frmProperties frm = new frmProperties();
            frm.Dispose();
        }
        //I have also tried frm.Close() which also does not work

此代码关闭了两个表单,但该进程仍处于活动状态.我该如何应对?

This code close the two forms, but the process remains active. How do I counter this?

推荐答案

也许您正在寻找 Application.Exit()?

这篇关于关闭表单后进程未关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆