Forms Collection for Visual Basic 6.0 Users
The Visual Basic 6.0 Forms collection is replaced by theproperty in Visual Basic 2005.
A Visual Basic 6.0 Forms collection is a collection whose elements represented each loaded form in an application. The collection includes the application's MDI form, MDI child forms, and non-MDI forms. The Forms collection has a single property, Count, which specifies the number of elements in the collection.
The Visual Basic 2005property returns a object that contains all of the application's open forms. The behavior is the same as the Forms collection, and it can be used in the same ways.
Code Changes for the Forms Collection
The following examples illustrate differences in coding techniques between Visual Basic 6.0 and Visual Basic 2005.
Code Changes for Getting a Count of Open Forms
The following code demonstrates how to return the number of forms currently open in an application.
' Visual Basic 6.0 MsgBox Forms.Count