|
-
May 4th, 2001, 11:28 AM
#1
App Closing
I have a function that is to run when my app is closed. I stuck it in the form's terminate event and it runs like it's supposed to when I use the menu to exit or a command button to exit. Now, when I try to use the close box at the top, it doesn't run. Is there a way I can get this to work? What kind of event happens when someone shuts down the app this way?
-
May 4th, 2001, 11:39 AM
#2
Re: App Closing
In the QueryUnload event of a form you can check to see if the X buton was pressed
private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
if UnloadMode=0 then
'Do What You Like
Cancel=true
end if
End Sub
This will stop the form unloading if they press the "X". Unloadmode will also be 0 if they try to close
the form from its own menu (By click on the icon in the top left corner)
Iouri Boutchkine
[email protected]
-
May 4th, 2001, 11:53 AM
#3
Re: App Closing
Now I have the problem that the program does not close when the x box is pushed. When I step through the program it runs my function when it is pushed, but the app does not close. What should I put in there to make it close the app?
-
May 4th, 2001, 11:59 AM
#4
Re: App Closing
Nevermind, I figured out if you remove the
Cancel = 0
it quits the app. Thanks so much for your help!
-
May 4th, 2001, 12:56 PM
#5
Re: App Closing
rate it if it helped you
Iouri Boutchkine
[email protected]
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
|