Results 1 to 14 of 14

Thread: App Exit

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207

    App Exit

    Does anyone know a good way to do something when the application has been told to exit. I have looked throught he msdn documents at the ApplicaitonExit Event but am unable (for some reason) to have it do the action (in this case display a message box).

    Jeremy

  2. #2
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    VB Code:
    1. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    2.     MsgBox("", MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, "Exit")
    3. End Sub

    There you go. Have fun!


    Furry
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Use the Main Form's Closing Event.

  4. #4
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    Hehe too slow! Look up!
    Last edited by Fat_N_Furry; Oct 18th, 2002 at 10:24 AM.
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    well , i got a perfect idea but maybe slower one too , when the user clicks the exit button , the main form shrinks resulting msgbox-like style with two buttons . Try to Imagine that , it's really magic !!

    have a nice end-from

  6. #6
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    That'd be cool!
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Arrr you might be Fat_N_Furry but you got speedy little fingers

  8. #8
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    LOL! That's funny. Do you want to know how much the cat from that picture weighs? 20 LBS! He's sleeping on one of my computer chairs right now. He's all tuckered out from rolling in catnip. Hehe
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207
    Actually the event doesn't seem to work, acording the documents that event does get called if the form is is being clossed by the application, only by the user.

    Jeremy

  10. #10
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    OK. So you want it to display a message box when you say Me.Close()? That's easy. Just put it before the Close statement.

    My mom just told me that I have to get off the internet and do something else now, so I'll see you guys in a few hours.


    Furry
    Last edited by Fat_N_Furry; Oct 18th, 2002 at 11:22 AM.
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  11. #11
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually the form close event fires regardless of who or what closes the application or even if the system is shutting down. Things like Application.Exit may force long processes to not finish or a msgbox to not appear though. This is wierd though because I had the exact opposite problem once, a msgbox in the closing event would partially hang my system when it was shutting down while the program was still loaded.

  12. #12
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    Originally posted by Edneeis
    Actually the form close event fires regardless of who or what closes the application or even if the system is shutting down.
    Yeah - I was doing some testing and I found that to be true...
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207
    Found the problem, apprently the event doesn't fire if you click the stop button in vb.

    Jeremy

  14. #14
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    Good. Glad to see you've found a solution.
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

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