Anthony Nystrom said:
Anytime I close a form should I also dispose such as:
me.close
me.dispose
What else Should I dispose... If I set a var to nothing should I also
dispose such as:
f = nothing
f.dispose
Just curious???
If there are objects to dispose, do it in Sub Dispose. As mentioned in the
other thread, you do not need to dispose the form. I must add that it
depends on whether the form has been shown modaly or modeless. If you close
a modal form (shown with Showdialog), it is not disposed automatically. You
can display the same Form instance again. Modeless Forms are disposed
automatically, and you have to create a new instance if you want to show the
Form again.
Concerning setting variables to Nothing: You can set it to Nothing as soon
as you don't need to use the variable again. It doesn't make sense to set it
to Nothing when the variable is destroyed anyway right after setting it to
nothing, like with local variables at the end of the procedure.
--
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html