|
-
Mar 15th, 2000, 05:10 PM
#1
Thread Starter
Addicted Member
Two questions about forms:
1. I have a form that can be called from some other forms. How do I know which form calls this form. Is there a property I can evaluate/examine (stacks?) or do I have to introduce a variable to hold the name of calling form?. There is the 'ownerform' paramater you can give using form.show method but I can't figure out how to use it in the called form to know who called...?
2. How do I check if a specific (child)form is open besides by looping through all open forms and checking the name/caption. I am looking for something like IsLoaded(frmMyForm) or IsOpen(frmMyForm), something VB-intrinsic that I might haven't come across yet..?
Thanks in advance
-
Mar 15th, 2000, 08:38 PM
#2
Frenzied Member
frmMyForm.Parent will give you the owner of the form.
frmMyForm.Visible will tell you if the form is loaded.(unless you hide it for some reason)
Hope this helps
-
Mar 19th, 2000, 04:25 PM
#3
Thread Starter
Addicted Member
I guess I forgot to mention these two important facts regarding question 1:
a. there is no 'parent' property of a form
b. a childform can't be set as an owner of a called form
As to question 2, just forms.visible is not enough, i need to know whether the form is loaded even if it's hidden.
-
Mar 19th, 2000, 04:30 PM
#4
Hyperactive Member
You can loop throught the Forms collection.
Note that when you access a property of the form and it's not loaded, it will load first. So that doesn't help, that way each form is always loaded... Better use the forms collection, that only contains the loaded forms.
-
Mar 20th, 2000, 02:32 PM
#5
Thread Starter
Addicted Member
I was really looking for a way without having to loop through the form collection. I guess there is none? and I just have to use the loop
or.. anyone else has any idea?
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
|