Results 1 to 3 of 3

Thread: Closing Application ..

  1. #1

    Thread Starter
    Hyperactive Member spoiledkid's Avatar
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    437

    Closing Application ..

    What is the best way to close your application in VB.NET. I have an mdi application with 10 child forms. My application starts with my MDI form. When user hits the Exit menu option, I just call End. Is it okay or is there a better way ?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Use Application.Exit() method :

    From MS Help File :

    Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed

    This method stops all running message loops on all threads and closes all windows of the application. This method does not force the application to exit. The Exit method is typically called from within a message loop, and forces Run to return. To exit a message loop for the current thread only, call ExitThread.

  3. #3
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Yup, use Application.Exit as Pirate said. I think End abruptly stops all executing threads, which is not recommended.

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