Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

Visual Basic Reference

Forms Collection Example

This example fills a list box with the captions of all the currently loaded forms.

Private 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
© 2015 Microsoft