|
-
Jul 26th, 2007, 11:55 PM
#1
Thread Starter
Lively Member
[RESOLVED] [2005] Close Event Not Always Executed
I want to save some data when a form is closed or the application terminates. I put a call to my save data method inside the close event sub yet it doesnt seem to get executed when I call application.exit.
-
Jul 27th, 2007, 12:01 AM
#2
Re: [2005] Close Event Not Always Executed
Could you show us your code please
-
Jul 27th, 2007, 12:03 AM
#3
Fanatic Member
Re: [2005] Close Event Not Always Executed
Which event do you have your code in?
Did you try putting a message box in the exit area to test if it gets displayed, or do a step by step code process by pressing f8?
vb Code:
Private Sub FormName_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Msgbox "I'm still open"
End Sub
Please RATE posts, click the RATE button to the left under the Users Name.
Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.
"As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood
-
Jul 27th, 2007, 12:09 AM
#4
Thread Starter
Lively Member
Re: [2005] Close Event Not Always Executed
I figured my error. Was using the old close method which does not get raised by the Application.Exit. The FormClosing method new to 2005 gets raised by Application.Exit
-
Jul 27th, 2007, 12:14 AM
#5
Fanatic Member
Re: [2005] Close Event Not Always Executed
Yeah, I had that same problem when I migrated from VB6. I was like, why are none of my files being updated at closing. hehe.
Please RATE posts, click the RATE button to the left under the Users Name.
Once your thread has been answered, Please use the Thread Tools and select RESOLVED so everyone knows your question has been answered.
"As I look past the light, I see the world I wished tonight, never the less, sleep has come, and death shall soon follow..." © 1998 Jeremy J Swartwood
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
|