|
-
Sep 17th, 2004, 02:05 PM
#1
Form UNLOAD question - vbFormOwner?? [RESOLVED - always search the FORUM first!]
I've got a MDI Parent/Child application.
In it we have a non-child form called frmLookup, where we store "lookup" values in a tree-view, that were used in the child forms.
We load this form initially from the MDIForm_Load event - but don't show it.
We fill the tree-view from the child forms.
We have a QUERYUNLOAD event for this frmLookup that if the unload mode = 0 (vbFormControlMenu), we simply cancel the unload and hide the form. That way the tree-view values are saved.
I've got a situation where the frmLookup gets put up on the screen by the "second" child form. Now when that "second" child form gets closed, it's triggering an unload mode = 5 (vbFormOwner) event on the frmLookup form.
I want the MDI PARENT to own this form, so it never leaves memory until the parent is closed.
How do I do this?
Thanks...
Last edited by szlamany; Sep 17th, 2004 at 02:56 PM.
-
Sep 17th, 2004, 02:31 PM
#2
This is driving me nuts - it appears that when a CHILD form does a MODAL show of this frmLookup form, it becomes the FORM OWNER, so it's unload event wants to unload this form.
Is there a better way to do this? A way to have the MDIPARENT own the form???
-
Sep 17th, 2004, 02:34 PM
#3
Why can't you have that TreeView directly on the your MDI form instead - inside some hidden picturebox ???
-
Sep 17th, 2004, 02:41 PM
#4
Demo on Monday - been using it this was for a long while - we weren't allowing people to close child forms till recently.
Didn't know about the problem till we started allowing CHILD forms to be closed.
This stinks.
They click a HISTORY button on a child form and the MODAL treeview form was appearing - they could move it around if it was blocking something. Click on some name or record that is in the tree-view and the form "spill" those lookup values into the textboxes on the CHILD forms.
Is there anyway to associate a new FORMOWNER before I HIDE the lookup form??
-
Sep 17th, 2004, 02:48 PM
#5
When you show a modal form without specifying an owner, the owner becomes the Form that called the Show method. Makes for some interesting debugging for sure.
Anyways, everytime you show the form specify the owner as the MDI Form.
Form1.Show vbModal, MDIForm1
-
Sep 17th, 2004, 02:52 PM
#6
Thanks - I just searched the forum and found a Marty posting with that same info - from 11/7/2003...
Originally posted by MartinLiss
Have you tried
frmModal.Show vbModal, frmParent
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
|