|
-
Apr 15th, 2003, 03:45 AM
#1
Thread Starter
Hyperactive Member
-
Apr 15th, 2003, 03:55 AM
#2
Well ...
Click on them one by one, maybe?
OK, can you elaborate your problem further? If a modal dialog box is visible, your app is not supposed to do anything till the user has dealt with the dialog box.
.
-
Apr 15th, 2003, 09:33 AM
#3
Thread Starter
Hyperactive Member
-
Apr 15th, 2003, 12:56 PM
#4
If you use the VB App Wizard, you will see that it creates a chunk of code in the unload event of the main form. That code unloads each form in the forms collection. It seems like that is what you are trying to achieve, with perhaps a modification or two.
If you want to close all forms except one, you can use that same loop with a line in it excluding the form you don't want to close. Where you put that loop is up to your design.
If the problem you are having is that unloading all the forms ends your program early, I would guess (and it's only a guess), that the first form you show is shown non-modally by the Main sub(). If that's the case, once all forms have been closed, Main has also ended, so the program is finished.
-
Apr 15th, 2003, 01:12 PM
#5
The problem with closing modal forms through code is that the only code that is running during the time a modal form is shown is the code belonging to that form. So you can only unload a modal form from that form.
With that said I must inform you that that is not 100% true... Timer events belonging to another form is still fired. However that will only happen if the app is compiled to native code, timers will not fire their events when you run the app from within VB or if you have compiled it to P-code.
Best regards
-
Apr 16th, 2003, 02:40 AM
#6
Well ...
While that may work for modal forms, will it also work for dialog boxes?
.
-
Apr 16th, 2003, 07:05 AM
#7
Re: Well ...
Originally posted by honeybee
While that may work for modal forms, will it also work for dialog boxes?
.
Hmmm.... modal forms are usually dialog boxes. I guess you refer to things as MsgBox and Open, Save As dialogs, and if so yes Timer events will be fired in a compiled EXE while these dialogs are shown. You can actually use a timer to get the handle of a MsgBox and move it if you like. Just remember that that will not work while running the app from the VB IDE.
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
|