|
-
May 26th, 2005, 09:50 AM
#1
Thread Starter
Lively Member
Get the close event of a form [RESOLVED]
Hi
Im trying to put some code,,when a form is close,,but i try with the unload and with the desactivate method,,but it doesnt enter in these methods..but i absolutly need to put code when the window is close,,,is there a way to cath this event. My form is a part of a project thats why its not unload right now
thanks
Mel
Last edited by DesyM; May 26th, 2005 at 10:02 AM.
-
May 26th, 2005, 09:55 AM
#2
Re: Get the close event of a form
The QueryUnload event fires whenever a form is closed, regardless of how it is closed.
You can write code that will do different things depending on how it is closed.
Is this what you mean?
-
May 26th, 2005, 10:00 AM
#3
Re: Get the close event of a form
Have a look at the QueryUnload Event it may help you 
Or, maybe the Terminate Event...
Edit: Sorry Hack I missed your post while I was looking for that link 
Cheers,
RyanJ
-
May 26th, 2005, 10:01 AM
#4
Thread Starter
Lively Member
-
May 26th, 2005, 10:03 AM
#5
Re: Get the close event of a form
 Originally Posted by DesyM
Ok thank you, thats what i need,,,the form_query_unload
it works well
thanks

FYI. Here is some info how how you can use "how" the form unloaded.
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'there are 5 unloadmode levels
Select Case UnloadMode
Case vbFormControlMenu 'UnloadMode 0
'form is being unloaded via the Close
'or by hitting the X in the upper right hand corner
'command from the System menu
Case vbFormCode 'UnloadMode 1
'Unload Me has been issued from code
Case vbAppWindows 'UnloadMode 2
'Windows itself is closing
Case vbAppTaskManager 'UnloadMode 3
'the Task Manager is closing the app
Case vbFormMDIForm 'UnloadMod 4
'an MDI child form is closing because
'its parent form is closing
End Select
End Sub
PS: Edit the first post in this thread and add your checkmark there.
Thanks.
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
|