|
-
Jan 7th, 2005, 06:40 AM
#1
Thread Starter
Frenzied Member
forms.count
Hello
does the forms.count store the number of forms which have been loaded, or does it also include the forms which are unloaded?
Last edited by vb_student; Jan 15th, 2005 at 08:31 PM.
-
Jan 7th, 2005, 06:59 AM
#2
-
Jan 7th, 2005, 07:03 AM
#3
Re: forms.count
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:
VB 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 Sub
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. Putin the second buttons click event, then click on the first command button again. This time, you will see, in the listbox, Form1 Form2
.Count will only return the number of forms currently loaded, not the number of forms in your project.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|