By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,165 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,165 IT Pros & Developers. It's quick & easy.

No Forms Collection

P: n/a
Does anybody know why VB.NET would omit the Forms collection available in
previous versions versions of VB? I imagine that there must be a reason why
they decided to do away with it, but I can't fathom why. Does anybody know?
Nov 21 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
I assume that they decided that it is not used by too many people and also
maybe it created some problems with the GC.

Anyway they do have a help topic on how to create your own collection if you
need one in MSDN
http://msdn.microsoft.com/library/de...alBasicNET.asp

Rgds,
Anand
http://www.dotnetindia.com

"Alex" wrote:
Does anybody know why VB.NET would omit the Forms collection available in
previous versions versions of VB? I imagine that there must be a reason why
they decided to do away with it, but I can't fathom why. Does anybody know?

Nov 21 '05 #2

P: n/a
Alex,
Does anybody know why VB.NET would omit the Forms collection available in
previous versions versions of VB? I imagine that there must be a reason
why
they decided to do away with it, but I can't fathom why. Does anybody
know?

Is this not a question from 2002 and almost forever answered?

In VBCom there is no collection from other controls. Now we can use for
every control a collection where the base clase Control is used that holds a
collection for that.

When you want you can create now as much collections of controls collections
shaped for your own need as you want.

Cor

Nov 21 '05 #3

P: n/a
"Alex" <pl*****@no.mail> schrieb:
Does anybody know why VB.NET would omit the Forms collection available in
previous versions versions of VB? I imagine that there must be a reason
why
they decided to do away with it, but I can't fathom why. Does anybody
know?


The 'Forms' collection as known from VB6 has gone:

Reclaim the Lost VB6 Forms Collection
<URL:http://www.fawcette.com/vsm/2002_12/online/hottips/lobel/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
In VBCom there is no collection from other controls. Now we can use for
every control a collection where the base clase Control is used that holds
a collection for that.

When you want you can create now as much collections of controls
collections shaped for your own need as you want.


.... which is a step backwards. VB6's forms collection was self-maintaining,
so you didn't need to add/remove forms from it.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

P: n/a
>
... which is a step backwards. VB6's forms collection was
self-maintaining, so you didn't need to add/remove forms from it.


I assume that you mean in your opinion. In my opinion it is a small
step..........................

:-)

Cor
Nov 21 '05 #6

P: n/a
"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.

Nov 21 '05 #7

P: n/a
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...

... which is a step backwards. VB6's forms collection was
self-maintaining, so you didn't need to add/remove forms from it.


I assume that you mean in your opinion. In my opinion it is a small
step..........................


How do you go about finding out if an instance of a particular form class
already exists?
Nov 21 '05 #8

P: n/a

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

Nov 21 '05 #9

P: n/a
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
... which is a step backwards. VB6's forms collection was
self-maintaining, so you didn't need to add/remove forms from it.


I assume that you mean in your opinion. In my opinion it is a small
step..........................


The main difference is that VB6 provided a "standardized" way to keep track
of form instances in the 'Forms' collection, which made exchanging forms
between projects much easier. In VB.NET, currently people have to implement
their own collection which leads to many different, non-compatible
solutions.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #10

P: n/a
Larry Lard wrote:
I would of course welcome examples of where Forms is geniunely useful
:)


I used to use the Forms collection for quite a few things.

A couple of examples:

I'd use it to determine whether a form in my application was already being
used. If the user tried to open a second instance of the form then I would
just pop the existing form to the front instead of opening another instance.
That was useful.

I also used to have multiple forms open that provided different views into
an object the user was working with. When the user moved to a different
object, all of the open windows would automatically update to view the new
object instead. This was achieved by iterating through the Forms collection,
identifying forms that needed to be updated and calling a method on each to
look at the new object.

In VB.NET I can work around most of the missing functionality because I'm
writing an MDI application, so I can use the MdiChildren array. There are
occasions where I do miss it though.

--

(O)enone

Nov 21 '05 #11

P: n/a
"Larry Lard" <la*******@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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.


If the Form object is being currently referenced then you wouldn't want it to
be GC'd.
Nov 21 '05 #12

P: n/a
Alex,

Are this enough articles to start with
http://groups-beta.google.com/group/...rch+this+group

Cor
Nov 21 '05 #13

P: n/a
Herfried,

The main difference is that VB6 provided a "standardized" way to keep
track of form instances in the 'Forms' collection, which made exchanging
forms between projects much easier. In VB.NET, currently people have to
implement their own collection which leads to many different,
non-compatible solutions.


This discussion in this thread looks for me about religion, you tell that
everybody needs it. And I don't need it, in those situations it has no
sense to discuss, you believe it or not.

I was more interesting in a reply on the message where you wrote about that
byte collection. I took some time to make if visible what you wrote.

Cor
Nov 21 '05 #14

P: n/a
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL*************@TK2MSFTNGP10.phx.gbl...
Are this enough articles to start with
http://groups-beta.google.com/group/...rch+this+group


Only if the articles go on to explain why MS decided to do away with it, which
is what my original question was (and still is).
Nov 21 '05 #15

P: n/a
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
The main difference is that VB6 provided a "standardized" way to keep
track of form instances in the 'Forms' collection, which made exchanging
forms between projects much easier. In VB.NET, currently people have to
implement their own collection which leads to many different,
non-compatible solutions.


This discussion in this thread looks for me about religion, you tell that
everybody needs it. And I don't need it, in those situations it has no
sense to discuss, you believe it or not.


Huh? Where did I write that everybody needs a 'Forms' collection?! The
whole discussion is absolutely not about "religion".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.