473,795 Members | 3,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1360
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.mai l> 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.co m/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******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP09.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 "standardiz ed" 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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2145
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 though each of the form's elements have to use PayPal's required naming conventions to pass the data to their server. Many of the forms have hard-coded data in them and these have not caused me any problems. The problems I am having are with 3 forms...
4
2419
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 explicitly referring to the Controls collection. Your code will be faster if you refer to the Controls collection implicitly. The following examples show two of the ways you might refer to a control named NewData on the form called OrderForm:
4
1787
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 Integer the current form. ouch. this works fine as long as the controls are all on one form.
6
9427
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 open/closed and their current state. now i can't. before i didn't have to declare numerous named instances each time i loaded or unloaded a form.
5
1443
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 closed, I want to check that no other forms are open - on any thread. Is there a way of checking for this easily? At the moment, I'm not keeping track of new threads that I create ie I create the new thread using code similar to as follows: ...
12
1974
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
1351
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 forms whenever the x is clicked on any of those forms, so I go to the closing event and cycle through the forms collection, closing each of them down like so. either Forms(n).Close
18
2343
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 through the forms collection, bringing forms to the front with API via hWnd, et.. and so on. The problem is that users are loosing windows behind others and I thought I would put a list together on an existing left handed menu of (i.e.) "My open...
21
10655
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 frm As Form ' Enumerate Forms collection. For Each frm In Forms
0
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9037
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.