MikeD
unread,Apr 11, 2022, 10:14:56 AM4/11/22You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 04/10/2022 8:47 PM, Kim Hawker wrote:
> I want to know if a form is open and running
> What is the correct way to place this in vb6?
> I don’t believe this is the correct way but just to give you an idea of what I’m asking I’ll post this:
> If Form12.Visible = True Then
No, you don't want to do that because if the form is not loaded that
will cause it to automatically load.
There is a Forms collection which contains every instance of loaded
forms. You can loop through that to check if it contains a form. This
gets a little more complicated if you have 2 or more instances of the
same form, though.
Alternatively, and this requires more effort but is probably better most
of the time, is to explicitly declare object variables for all your form
instances and then you can just check if those are Nothing to determine
if an instance of the form is loaded.
At least, that's what my memory is. Granted, it's been a few years
since I've done much with VB6 other than maintaining legacy VB6 apps.
Mike