Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Simple question (I think) {access unloaded forms}


Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2004, 01:55 PM
Kedmyster Kedmyster is offline
Freshman
 
Join Date: Oct 2003
Posts: 48
Default Simple question (I think) {access unloaded forms}


Hey, so I made this procedure which should load all forms there is in the project, it goes like this:

Code:
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.

Last edited by Kedmyster; 11-01-2004 at 02:27 PM.
Reply With Quote
  #2  
Old 11-01-2004, 02:55 PM
VBJoe's Avatar
VBJoe VBJoe is offline
Village VB Idiot

* Expert *
 
Join Date: Jan 2003
Location: Idaho
Posts: 1,850
Default

Code:
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.
Reply With Quote
  #3  
Old 11-01-2004, 09:41 PM
Kedmyster Kedmyster is offline
Freshman
 
Join Date: Oct 2003
Posts: 48
Default

Oh well, if any one knows a better way please let me know.
thanks.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->