表单自动关闭在vb.net 2010中 [英] Form Automatically Closing In vb.net 2010

查看:69
本文介绍了表单自动关闭在vb.net 2010中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时当我的表单关闭时,应用程序仍在运行。我在使用msgbox函数时注意到了这种行为。



我没有线程也没有运行计时器,所以问题是什么?我正在使用VB.NET。



谢谢

Sometimes when my the form is closed the application is still running. I noticed this behaviour when using the msgbox function.

I have no thread nor timer running, so what the problem??? I am using VB.NET.

Thanks

推荐答案

你是什么意思当你注意到这种行为时使用msgbox功能?你能告诉我们你正在谈论的代码吗?如果没有看到您的代码,我们无法帮助您找到仍在运行的内容。此外,您的项目只有一个表格吗?或几个?



单击解决方案资源管理器中的我的项目,然后单击应用程序选项卡,您为关闭模式设置了什么?如果您有启动表单关闭时并且您有多个表单,则问题可能是您实际上没有关闭项目的启动表单。如果你有当最后一个表格关闭,那么你可能隐藏了一个表格,但没有完全关闭它,这就是为什么它仍在运行。



如果更改这些设置和/或确保所有表格都关闭不起作用,你总是可以使用

Application.Exit() [ ^ ]

让整个应用程序关闭。
What do you mean you noticed this behaviour when using the msgbox function? Can you show us the code you are talking about? We can't help you find what is still running without seeing your code. Also, does your project have just one form? Or several?

Click on My Project in the solution explorer and click on the Application tab, what do you have set for Shutdown mode? If you have "When startup form closes" and you have multiple forms, the problem could be that you haven't actually closed the startup form of your project. If you have "When last form closes" then perhaps you have hidden a form but not closed it entirely and that's why it's still running.

If changing those settings and/or making sure that all forms are closed doesn't work, you could always use
Application.Exit()[^]
to get the entire application to shutdown.


这篇关于表单自动关闭在vb.net 2010中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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