Hello
does the forms.count store the number of forms which have been loaded, or does it also include the forms which are unloaded?
Printable View
Hello
does the forms.count store the number of forms which have been loaded, or does it also include the forms which are unloaded?
only the loaded forms
Try a little experient. Open a new project, and add three or four forms. One Form1, add a list box and a command button. In the command button's click event, place this code:Run the project and click the button. You will see one caption in the listbox and that is for Form1. Stop and project and add another command button. PutVB Code:
Private Sub Command1_Click() Dim i As Integer List1.Clear For i = 0 To Forms.Count - 1 List1.AddItem Forms(i).Caption Next End Subin the second buttons click event, then click on the first command button again. This time, you will see, in the listbox, Form1 Form2VB Code:
Form2.Show
.Count will only return the number of forms currently loaded, not the number of forms in your project.