473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

No Forms Collection

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
15 1317
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
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
"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
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
>
... 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
"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
"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

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
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
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
"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
Alex,

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

Cor
Nov 21 '05 #13
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark Hannon | last post by:
I am designing a PayPal shopping cart/store for a client and have placed several of PayPal's shopping cart forms on the page to correspond with different products. Each form has a unique name...
4
by: Soryt | last post by:
Hi everyone ! 1) An example from help: "Each Form object has a Controls collection, which contains all controls on the form. You can refer to a control on a form either by implicitly or...
4
by: sparks | last post by:
OK we have it so we can use tables to define skip patterns on our forms. BUT we can only do one form. Public Function skipPattern(currentFrm As Form, Optional currentCtl As Control = Null) As...
6
by: Edwinah63 | last post by:
Hi everyone, could someone give me some thoughts on the best way to manage mdi parent and child forms? in vb6 i could scroll through the forms collection and determine which forms were...
5
by: Simon Verona | last post by:
I have an application with a menu system which creates a new thread when a menu item is selected - some of these other threads may open a form for user interaction. Before the menu system is...
12
by: Peter Van Wilrijk | last post by:
Hi, In VB6 I have the following code ... Dim frmLink As Form Set frmLink = Forms.Add(stringformname) frmLink.Show 'wait until all data has been loaded Do Until frmLink.Loaded = 21 DoEvent
2
by: Yuk Tang | last post by:
I have created my own custom forms called baseform, inheriting normal form properties and such. Baseform is, as can be expected, the basis for the other forms in my project. I want to close all...
18
by: Jerry Boone | last post by:
I'm looking for a way to fire a public sub/function when a form is opened and closed - without using form level events. I have already done some extensive form work with instancing, looping...
21
by: MLH | last post by:
Am having trouble with the following snippet. It stops after only cycling thru open forms. There are many more than that. How to modify this to cycle thru all forms? Sub AllOpenForms() Dim...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.