Results 1 to 5 of 5

Thread: Forms - navigation & detection

  1. #1

    Thread Starter
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    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

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

  3. #3

    Thread Starter
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    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.

  4. #4
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    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.

  5. #5

    Thread Starter
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    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
  •  



Click Here to Expand Forum to Full Width