Alex wrote:
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl... Is this not a question from 2002 and almost forever answered?
I don't know if this is a question from 2002 or not as I wasn't
doing .net development in 2002. I did do a Usenet and an MSDN search before
posting my question and I found several posts or articles dealing with this as
a fact - and with workarounds for this issue - but I found none that delved
into why. After the several helpful replies to my initial post, I still don't
know, and I still wonder why MS decided to do this. I can't imagine that it was
an omission.
While I am not privy to MS internal decisionmaking, I can see that one
problem might be this:
In VB6 Forms is a collection of all 'loaded' forms. In Vb.Net I am not
sure there is really any such thing as a 'loaded' form. There are those
Form objects which are currently referenced; visible forms; but no real
in-between state that corresponds to a VB6 'Load'ed but not visible.
OK maybe you could have a collection of all Form objects that are
currently referenced - but unless you used WeakReferences (which I only
found out about the other day), this would stop forms ever being GC'd.
I don't think it's *too* onerous to require developers to keep track of
the objects they create. Personally I think the only times I ever
actually used the Forms collection were when I had lost track of a form
and found myself at a point where I thought I had exited everything but
still was in run-mode. I used to have a debug routine at the end of my
main execution path that Debug.Print'd everything in Forms - that way I
could try and trace what I had forgotten.
I would of course welcome examples of where Forms is geniunely useful
:)
--
Larry Lard
Replies to group please