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. How to close all open forms.

How to close all open forms.

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
8 Posts 2 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.
  • C Offline
    C Offline
    coolsatty
    wrote on last edited by
    #1

    I have created an application in which there r several forms open and when i click logout button then all the open forms should get closed and login page should get open.so, how do i close all open forms.

    coolsatty

    E 1 Reply Last reply
    0
    • C coolsatty

      I have created an application in which there r several forms open and when i click logout button then all the open forms should get closed and login page should get open.so, how do i close all open forms.

      coolsatty

      E Offline
      E Offline
      Eslam Afifi
      wrote on last edited by
      #2

      Application.OpenForms Gets a collection of opened forms owned by the application.

      Eslam Afifi

      C 1 Reply Last reply
      0
      • E Eslam Afifi

        Application.OpenForms Gets a collection of opened forms owned by the application.

        Eslam Afifi

        C Offline
        C Offline
        coolsatty
        wrote on last edited by
        #3

        but how do i close it.

        coolsatty

        E 1 Reply Last reply
        0
        • C coolsatty

          but how do i close it.

          coolsatty

          E Offline
          E Offline
          Eslam Afifi
          wrote on last edited by
          #4

          iterate through them and close them

          For Each form As Form In Application.OpenForms
              form.Close() ' close the form
              form.Dispose() ' to clean up resources
          Next
          

          Eslam Afifi

          C 1 Reply Last reply
          0
          • E Eslam Afifi

            iterate through them and close them

            For Each form As Form In Application.OpenForms
                form.Close() ' close the form
                form.Dispose() ' to clean up resources
            Next
            

            Eslam Afifi

            C Offline
            C Offline
            coolsatty
            wrote on last edited by
            #5

            application.openforms is not there in vb.net.

            coolsatty

            E 1 Reply Last reply
            0
            • C coolsatty

              application.openforms is not there in vb.net.

              coolsatty

              E Offline
              E Offline
              Eslam Afifi
              wrote on last edited by
              #6

              Application.OpenForms is new to the .Net Framework 2.0 (VB 2005)

              Eslam Afifi

              C 1 Reply Last reply
              0
              • E Eslam Afifi

                Application.OpenForms is new to the .Net Framework 2.0 (VB 2005)

                Eslam Afifi

                C Offline
                C Offline
                coolsatty
                wrote on last edited by
                #7

                then how to do in VB 2003.

                coolsatty

                E 1 Reply Last reply
                0
                • C coolsatty

                  then how to do in VB 2003.

                  coolsatty

                  E Offline
                  E Offline
                  Eslam Afifi
                  wrote on last edited by
                  #8

                  Sorry, I can't help It's been a long time since I used the .Net 1.1 and I currently don't have VS 2003 installed.

                  Eslam Afifi

                  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