|
|
Title | See if a form of a given type is loaded |
Keywords | form loaded, form type |
Categories | Controls |
|
|
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
|
|
|
|
|
|