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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Code to close all instances of a VB Application with one button

Code to close all instances of a VB Application with one button

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 3 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.
  • E Offline
    E Offline
    ensuvari
    wrote on last edited by
    #1

    Hi Does anyone know if there is some sort of button code which can close all instances of your application? I want to be able to close all forms and all instances of an application with the click of one button. Sometimes, when I use the Me.Visible = False code , instances of my application are still running unseen. I want to be able to avoid this. Regards ensuvari

    C D 2 Replies Last reply
    0
    • E ensuvari

      Hi Does anyone know if there is some sort of button code which can close all instances of your application? I want to be able to close all forms and all instances of an application with the click of one button. Sometimes, when I use the Me.Visible = False code , instances of my application are still running unseen. I want to be able to avoid this. Regards ensuvari

      C Offline
      C Offline
      Chatura Dilan
      wrote on last edited by
      #2

      You can use either End or Application.Exit() chatura

      1 Reply Last reply
      0
      • E ensuvari

        Hi Does anyone know if there is some sort of button code which can close all instances of your application? I want to be able to close all forms and all instances of an application with the click of one button. Sometimes, when I use the Me.Visible = False code , instances of my application are still running unseen. I want to be able to avoid this. Regards ensuvari

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

        ensuvari wrote:

        when I use the Me.Visible = False code , instances of my application are still running unseen

        Ummmmm....who told you that Visble=False will clsoe an application??? :confused: That just hides the window you set it on, nothing more. So, yeah, the app is still running... You'll have to use the Process[^] class, and it's GetProcessesByName method, to get an array of Process objects. Then you can call Close on each of those objects to close every instance of your app. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        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