See Also Properties Example
Description
A collection The collection includes the application's MDI form, MDI child forms, and non-MDI forms . The Forms collection has a single property, Count , that specifies the number of elements in the collection.
Usage
Forms(index)[.control][.property][ = setting ]
Remarks
In the preceding syntax, the range of index is 0 to Forms.Count-1. The Forms collection is useful for iterating through all loaded forms in an application. Note that Forms is a keyword, but not a reserved word. It identifies an intrinsic global variable named Forms. You can use Forms(index) as an argument to a function with a parameter of type Form.
Count
Help:
Controls Collection
Dim Statement
Programmer's Guide:
Chapter 8, "Objects and Instances"
The OBJECTS.MAK file referred to in Chapter 8 of the Programmer's Guide includes the following procedure to fill a list box with the captions of all the currently loaded forms:
Sub Form_Activate ()
Dim I ' Declare variable.
' Refill list (in case an instance was added or removed).
lstForms.Clear ' Clear list box.
For I = 0 To Forms.Count - 1
lstForms.AddItem Forms(I).Caption
Next I
End Sub