Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Close Event Not Always Executed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Resolved [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.

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: [2005] Close Event Not Always Executed

    Could you show us your code please

  3. #3
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    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:
    1. Private Sub FormName_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    2. Msgbox "I'm still open"
    3. 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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    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

  5. #5
    Fanatic Member
    Join Date
    Jul 2006
    Location
    Anchorage, Alaska
    Posts
    545

    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
  •  



Click Here to Expand Forum to Full Width