Simple question (I think) {access unloaded forms}

Kedmyster
11-01-2004, 02:55 PM
Hey, so I made this procedure which should load all forms there is in the project, it goes like this:


Sub LoadAll()
Dim Frm As Form
For Each Frm In Forms
If (Frm.Tag <> frm_Menu.Tag) Then
Load Frm
frm_Menu.ProgressBar.Value = frm_Menu.ProgressBar.Value + 1
End If
Next
End Sub


I came into a conclusion that only loaded forms are in this 'Forms' gruop which doesn't really help me cause I want to load them =P

Is there a way to access all forms in the project, run through them all and load them one by one?
I'd appreciate any kind of help.
Thanks,
kedmyster.

VBJoe
11-01-2004, 03:55 PM
Public Sub LoadAll()
Load Form1
Load Form2
Load Form3
'...
End Sub

:-\

The Forms Collection is used to enumerate Loaded Forms only, unfortunately. I don't know of any way to get a Collection of all Form objects in the Project, loaded or unloaded.

I'm pretty sure that .NET can do what you need (check the the Reflection Classes). Someone can correct me if I'm wrong.

Kedmyster
11-01-2004, 10:41 PM
Oh well, if any one knows a better way please let me know.
thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum