|
-
Jul 6th, 2000, 05:57 AM
#1
Thread Starter
Addicted Member
Hi,
How can I check if a Form is already loaded?
Thanks
Michel Jr.
-
Jul 6th, 2000, 06:44 AM
#2
Fanatic Member
Hope this helps 
Code:
Public Function FormIsOpen(strForm As String) As Boolean
'***************************************************************************
'Purpose: Check if a given form is open or not.
'Parameters: strForm - Name of the form to check for.
'Returns: True/False - Form open?.
'***************************************************************************
Dim frm As Form
FormIsOpen = False
For Each frm In Forms
If frm.Name = strForm Then FormIsOpen = True
Next frm
End Function
-
Jul 6th, 2000, 07:21 AM
#3
New Member
Visible Property
That's some neat code Stevie, but can't you just check the visible property of the form???
if form1.visible = true then
' the form is already loaded
end if
Or would the form have to have focus for this to work?
Just an idea.....
Jonathan (Co President - Big Berdie International)
Karl Moore RULEZ!
"Pipers Do It With Amazing Grace!"
-
Jul 6th, 2000, 07:25 AM
#4
Fanatic Member
Big_Berdie,
If the form you were testing the visible propert of was not loaded, it will be now.
As soon as you refrecnce a property of the form, the form is loaded into memory. So Stevie's way is the way to do it.
Iain, thats with an i by the way!
-
Jul 6th, 2000, 07:48 AM
#5
Lively Member
Plus a form can be loaded, but not visible. If you use the "Load Form" then form_load routine is run, but the form is not visible until the form.visble = true is run.
VB 6 Professional Edition
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|