Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Completly close program

Completly close program

Scheduled Pinned Locked Moved Visual Basic
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luke_Nava
    wrote on last edited by
    #1

    Is there a command that will close a program and all its forms. Right now i have a program that wont close when all the forms are gone. I am using this code to switch from form to form: Dim f As New Form2 f.StartPosition = FormStartPosition.Manual f.Location = Me.Location f.Show() Me.Hide() Thanks.

    G D L 3 Replies Last reply
    0
    • L Luke_Nava

      Is there a command that will close a program and all its forms. Right now i have a program that wont close when all the forms are gone. I am using this code to switch from form to form: Dim f As New Form2 f.StartPosition = FormStartPosition.Manual f.Location = Me.Location f.Show() Me.Hide() Thanks.

      G Offline
      G Offline
      gr8coaster329
      wrote on last edited by
      #2

      the command 'Application.Exit()' will completly close the program - Kyle

      1 Reply Last reply
      0
      • L Luke_Nava

        Is there a command that will close a program and all its forms. Right now i have a program that wont close when all the forms are gone. I am using this code to switch from form to form: Dim f As New Form2 f.StartPosition = FormStartPosition.Manual f.Location = Me.Location f.Show() Me.Hide() Thanks.

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Ummm...Me.Hide() doesn't close the form, it just makes it invisible. You're app is apparently still running because you never closed all your forms, active, invisible, or otherwise. In order to shutdown your app, you must close your startup form. This form starts the message pump for you application. Since your app is still running, this means that the app's message pump is still running. If the message pump is still running, you never closed your startup form. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        A 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Ummm...Me.Hide() doesn't close the form, it just makes it invisible. You're app is apparently still running because you never closed all your forms, active, invisible, or otherwise. In order to shutdown your app, you must close your startup form. This form starts the message pump for you application. Since your app is still running, this means that the app's message pump is still running. If the message pump is still running, you never closed your startup form. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          A Offline
          A Offline
          alien viper
          wrote on last edited by
          #4

          to completly close your program you can use following commands '(To close all form and exit but not other threads) Application.Exit OR '(To close all forms and threads) Application.ExitThread() !alien!

          D 1 Reply Last reply
          0
          • A alien viper

            to completly close your program you can use following commands '(To close all form and exit but not other threads) Application.Exit OR '(To close all forms and threads) Application.ExitThread() !alien!

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            I know that. I'm just explaining WHY his app didn't close. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            1 Reply Last reply
            0
            • L Luke_Nava

              Is there a command that will close a program and all its forms. Right now i have a program that wont close when all the forms are gone. I am using this code to switch from form to form: Dim f As New Form2 f.StartPosition = FormStartPosition.Manual f.Location = Me.Location f.Show() Me.Hide() Thanks.

              L Offline
              L Offline
              Luke_Nava
              wrote on last edited by
              #6

              Thanks for your help and the explination.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups