Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested modal forms 1

Status
Not open for further replies.

rrdoc

Programmer
Feb 21, 1999
5
US
How do you set up nested modal forms?  For example, a selection in form A launches form B modally.  Selections in form B launch form C or form D modally.  To get back to form A, you must close form C and then close form B.  VB does not seem to allow more than one modal form at a time, but I see this done commonly in Windows, eg. in Printer and Printer Setup dialogs.  What's the trick?  Thanks.
 
You may need to keep track of your own global varaiables.<br>Also ask any user if they like to go way down in 3-4 forms and have to come back.<br>The answer will be no. Going 3-4 forms deep in counter productive. Thats why its not supported too.<br>Take a look at the tree view that's the next up and coming user interface. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
I appreciate the problem of too many nested forms, however in my application, the user spends most of his time on the second level, occassionally uses the third level and rarely uses the fourth level.&nbsp;&nbsp;The workaround I am using currently involves a function that is called in each event procedure of other forms.&nbsp;&nbsp;If the form is not the current
 
Sorry, my response got cut off . . .<br>If the form is not the current form, an exit sub prevents the event.&nbsp;&nbsp;It works, but it is messy and hard to maintain.&nbsp;&nbsp;Is there a way to force VB to handle nested modal form and their overhead?&nbsp;&nbsp;It seems that this would be a common problem, but I haven't seen anything about it in my programming books or the Web.&nbsp;&nbsp;BTW, I considered using the list view control.&nbsp;&nbsp;I saw a similar application that used it, but with long lists, the item you need is usually scrolled off of the screen.&nbsp;&nbsp;It was awkward at best.&nbsp;&nbsp;Thanks.
 
You can't have more than one modal form open at once.<br><br>You can however, simulate this by disabling the parent form as the first action of the child - which would then get disabled when it shows its own child.<br><br>As the forms unload they re-enable the parent form as thier last action.<br><br>Mike<br> <p>Mike<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>Please don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Thanks for the suggestion to disable the parent form.&nbsp;&nbsp;That works well and is a lot easier to maintain.&nbsp;&nbsp;&nbsp;Unbeleivably, as I was playing with this, I found that I COULD use nested modal forms in VB6!&nbsp;&nbsp;I had not tried this since I originally failed using VB5.&nbsp;&nbsp;I have not gone back to test it in VB5, so I am not sure if this is a change in VB6 or my improper coding.&nbsp;&nbsp;The key to making it work is that all the nested forms must remain active.&nbsp;&nbsp;If you hide the parent form, you get an error when you close the child and try to show the parent again.&nbsp;&nbsp;One problem has occurred, though.&nbsp;&nbsp;My DBCombo boxes stopped responding to clicks in one of the nested modal forms (the first time I click on an item it is selected.&nbsp;&nbsp;If I click on the DBCombo box again nothing happens).&nbsp;&nbsp;If I open it as non-modal, it works fine.&nbsp;&nbsp;Not sure why, but for now I will use the disable trick suggested by Mike Lacey on that form.&nbsp;&nbsp;Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top