在FormClosed中做Me.Dispose是否有意义 [英] Does it make sense in FormClosed to do Me.Dispose

查看:71
本文介绍了在FormClosed中做Me.Dispose是否有意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在主程序中,我检查是否已经处理了某个表格。


这种表格的FormClosed事件是否有意义:

Me.Dispose以确保下次检查时它被处理掉。

或者是自动的吗?

谢谢

In the main program I check to see if a certain form has been disposed.

Does it make sense in that form''s FormClosed event to do:
Me.Dispose to make sure it is disposed the next time I check.
Or is that automatic?
Thanks

推荐答案



"活性" < ac ********** @ a-znet.comwrote in message

news:uG ************* @ TK2MSFTNGP05.phx。 gbl ...

" active" <ac**********@a-znet.comwrote in message
news:uG*************@TK2MSFTNGP05.phx.gbl...

在主程序中,我检查某个表格是否已被处理。


是否在那种形式的'FormClosed事件中有意义:

Me.Dispose以确保它在下次检查时被处理掉。

或者是自动的?


谢谢
In the main program I check to see if a certain form has been disposed.

Does it make sense in that form''s FormClosed event to do:
Me.Dispose to make sure it is disposed the next time I check.
Or is that automatic?
Thanks



除非您的应用程序存在资源问题,否则您应该只需

允许自动垃圾收集来完成它的工作。

在大多数情况下,你不需要干涉。

Unless you have resource issues with your application, you should simply
allow automatic garbage collection to do its job.
In most cases, you do not need to interfere.


" pvdg42" < pv **** @ newsgroups.nospamwrote in message

news:Oo ************** @ TK2MSFTNGP03.phx.gbl ...
"pvdg42" <pv****@newsgroups.nospamwrote in message
news:Oo**************@TK2MSFTNGP03.phx.gbl...

除非您的应用程序存在资源问题,否则您应该简单地使用
允许自动垃圾收集来完成其工作。

在大多数情况下,您不需要干涉。
Unless you have resource issues with your application, you should simply
allow automatic garbage collection to do its job.
In most cases, you do not need to interfere.



你不打算在有任何处理方法的地方打电话给Dispose吗?


Michael

Aren''t you meant to call Dispose on anything that has a dispose method?

Michael


活动,


看起来很奇怪,但AFAIK是与

Form.Showdialog一起使用的表格对话资源。这些showdialogforms是

中的一个例外处理,因为它们不涉及自动处理主体形式。


Cor

"活性" < ac ********** @ a-znet.comschreef in bericht

news:uG ************* @ TK2MSFTNGP05.phx。 gbl ...
Active,

It seems strange, but AFAIK are the forms which are used with
Form.Showdialog using the dialogresources. Those showdialogforms are one of
the exceptions to dispose, because they are not involved in the automatic
disposing of the mainform.

Cor
" active" <ac**********@a-znet.comschreef in bericht
news:uG*************@TK2MSFTNGP05.phx.gbl...

在主程序中,我检查某个表格是否已被处理。


是否在那种形式的'FormClosed事件中有意义:

Me.Dispose以确保它在下次检查时被处理掉。

或者是自动的?


谢谢
In the main program I check to see if a certain form has been disposed.

Does it make sense in that form''s FormClosed event to do:
Me.Dispose to make sure it is disposed the next time I check.
Or is that automatic?
Thanks



这篇关于在FormClosed中做Me.Dispose是否有意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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