Close userform using myForm.Hide or Unload Me

人盡茶涼 提交于 2019-12-02 09:28:10

I found an interesting answer to my question I thought it would be useful to post it here.

Unload me

Unload me

Removes the form from the memory and stop the application if you do so on the main form of your project. Every modification that you did in your form will be lost.

Hide

myForm.Hide

Only hide the form. If you do so on the main form of your application, this will not end the program (the debug mode would still be running for example). Every modification that you do in your form will be kept for the next time you show your form.

Which one to use?

Depends of the situation I believe. In my project, my form was made to be open/close multiple times so I chose to only hide it to avoid having to allow memory for my form every time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!