Skip to content

Planet-Source-Code/leigh-bowers-is-form-loaded__1-5989

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Is Form Loaded?

Description

This function will tell you if your form is loaded (instantiated) or not. If you use the form's "Visible" property to determine this, the form is instantiated if it's not already loaded. This results in the form's "Load" event being executed unnecessarily. This function has none of the above overheads...

More Info

Syntax: If IsLoaded("frmTest") Then...

True (loaded) or False (not loaded)

Submitted On
By Leigh Bowers
Level Beginner
User Rating 4.3 (13 globes from 3 users)
Compatibility VB 4.0 (32-bit), VB 5.0, VB 6.0
Category Miscellaneous
World Visual Basic
Archive File

Source Code

Public Function IsLoaded(sForm As String) as Boolean
Dim Frm As Form
' Loop through the Forms collection looking
' for the form of interest...
 For Each Frm In Forms
 If Frm.Name = sForm Then
  ' Found form in the collection
  IsLoaded = True
  Exit For
 End If
 Next
End Function

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published