|
-
Sep 14th, 2000, 09:28 PM
#1
This must be an easy question for you guys.
Thanks
-
Sep 14th, 2000, 09:33 PM
#2
Fanatic Member
If you meen another instance of your app then:
[code]
If App.PrevInstance Then
MsgBox "Already Running"
End
End if
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Sep 14th, 2000, 09:44 PM
#3
Frenzied Member
gwdash, thats for the program, I think that sandra means form
and I think that this is what you want:
Code:
if form2.visible = true then
'form 2 is loaded
else
if form2.visivle = false then
'form 2 isn't loaded
end if
NXSupport - Your one-stop source for computer help
-
Sep 14th, 2000, 09:50 PM
#4
Fanatic Member
i know, i thought she might want program,
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Sep 15th, 2000, 04:03 AM
#5
Addicted Member
If it's loaded, it's in the forms collection.
Sandra, once you've loaded a form, it's in the forms collection. so if you want to find out simply do something like this:
Code:
Private Sub Command1_Click()
Dim frmLocal As Form
If Not FormLoaded("Form2") Then
Load Form2
MsgBox "Form Loaded"
Else
MsgBox "Form2 already loaded"
End If
End Sub
Public Function FormLoaded(strForm As String) As Boolean
Dim frmLocal As Form
FormLoaded = False
For Each frmLocal In Forms
If strForm = frmLocal.Name Then
FormLoaded = True
Exit For
End If
Next frmLocal
End Function
Regards,
Laurens
Using VB5 Enterprise edition SP3
VB6 Enterprise edition SP5
-
Sep 15th, 2000, 04:34 AM
#6
I would go with LAURENS suggestion because a form actually loads on first use. So if you check the Visible property the form will be loaded to check that property value.
-
Sep 15th, 2000, 02:29 PM
#7
Guys, you have been great! Yes, what Laurens said is exactly what I want, but I have learned something from other stuff posted here as an answer too.
Thanks!
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
|