c#关闭窗口但不关闭线程

也就是说,不用this.close()方法 还有其他方法实现吗?
2025-02-22 12:54:57
推荐回答(5个)
回答1:

this.close() 不关闭主线程吗?因为你的this是启动窗体,他关闭了程序也就结束了。假如this不是启动窗口就没问题了。你只能隐藏启动窗体。

回答2:

private void btnHide_Click(object sender, EventArgs e)
{
this.Hide();
}

回答3:

Application.Exit()
Application.ExitThead();

回答4:

关闭窗口而进程还存在,就只有隐藏窗口了
this.Hide();

回答5:

前台线程