Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 当我关闭启动表单时,如何防止应用程序终止?
当主窗体关闭时,如何阻止应用程序结束?我想检查如果Application.OpenForms.Count == 1它是真的,然后才关闭应用程序。所以我想在最后一个表单关闭时关闭应用程序。
Application.OpenForms.Count == 1