Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleSee if a form of a given type is loaded
Keywordsform loaded, form type
CategoriesControls
 
The reason this is necessary is that you cannot easily look at the form itself. If you look at the form or its properties, that tends to load the form if it is not already loaded. Looking in the Forms collection does not involve the form in any way if it is not already loaded.

The Form1IsLoaded method searches the Forms collection for a form of type Form1. Other functions work similarly.

 
' Return True if a Form1 is loaded.
Public Function Form1IsLoaded() As Boolean
Dim frm As Form

    Form1IsLoaded = False
    For Each frm In Forms
        If TypeOf frm Is Form1 Then
            Form1IsLoaded = True
            Exit For
        End If
    Next frm
End Function
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated