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 show a form after closing it ..

How to show a form after closing it ..

Scheduled Pinned Locked Moved Visual Basic
helptutorial
8 Posts 5 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.
  • M Offline
    M Offline
    Modern_night
    wrote on last edited by
    #1

    when i view a from from another one .. if i closed this form from the x buttom on the top courner .. how could i show this form again .. or if theres away that i can prvent the user from closing the form and hide it instead .. any one have an idea about how to solv this problem .. reply me plz لا اله الا الله محمد رسول الله

    C S 2 Replies Last reply
    0
    • M Modern_night

      when i view a from from another one .. if i closed this form from the x buttom on the top courner .. how could i show this form again .. or if theres away that i can prvent the user from closing the form and hide it instead .. any one have an idea about how to solv this problem .. reply me plz لا اله الا الله محمد رسول الله

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Dunno what's possible in VB, but once you click the X, the form is destroyed. If you can catch the close event, you can set the form to be invisible. It will need to be modeless, otherwise it will maintain the focus and your main window will not be responsive. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      F 1 Reply Last reply
      0
      • C Christian Graus

        Dunno what's possible in VB, but once you click the X, the form is destroyed. If you can catch the close event, you can set the form to be invisible. It will need to be modeless, otherwise it will maintain the focus and your main window will not be responsive. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        F Offline
        F Offline
        Fade Amit BS
        wrote on last edited by
        #3

        The reason the child form is destroyed is becuase you loss all references to it. if your working in vb.net you need to create a variable in a different class, holding a reference to your created form, or the reference can be 'Shared' (which i don't reccommend) if you are working in vb6, you can try do the same as for the .net (but i'm not sure if it would work) or try to create the form in a different parent form. you can also monitor the form's 'Closing' event(.net) or 'QueryUnload' event(vb6) and then you can cancel the termination of the form and just hide it. in both cases you need to set the 'Cancel' parameter to 'True'. Fade (Amit BS)

        1 Reply Last reply
        0
        • M Modern_night

          when i view a from from another one .. if i closed this form from the x buttom on the top courner .. how could i show this form again .. or if theres away that i can prvent the user from closing the form and hide it instead .. any one have an idea about how to solv this problem .. reply me plz لا اله الا الله محمد رسول الله

          S Offline
          S Offline
          Steven Campbell
          wrote on last edited by
          #4

          Inside of the form_close event (or form_closing in VB.NET), you can cancel the unload, and hide the form instead. Just remember to actually unload the form somewhere else in your code, or you will be sitting with a hidden form in memory.


          my blog

          M 1 Reply Last reply
          0
          • S Steven Campbell

            Inside of the form_close event (or form_closing in VB.NET), you can cancel the unload, and hide the form instead. Just remember to actually unload the form somewhere else in your code, or you will be sitting with a hidden form in memory.


            my blog

            M Offline
            M Offline
            Modern_night
            wrote on last edited by
            #5

            How to cancel the unload event ..??? i tried to do this befor but i just dont know how to cancel the unload event لا اله الا الله محمد رسول الله

            S 1 Reply Last reply
            0
            • M Modern_night

              How to cancel the unload event ..??? i tried to do this befor but i just dont know how to cancel the unload event لا اله الا الله محمد رسول الله

              S Offline
              S Offline
              Steven Campbell
              wrote on last edited by
              #6

              What language are you using, VB6 or VB.NET?


              my blog

              M 1 Reply Last reply
              0
              • S Steven Campbell

                What language are you using, VB6 or VB.NET?


                my blog

                M Offline
                M Offline
                Modern_night
                wrote on last edited by
                #7

                VB.net theres no problem with showing forms after closing it in vb6 .. but i cant do it with vb.net hope you reply soon ... and thanx for care. لا اله الا الله محمد رسول الله

                J 1 Reply Last reply
                0
                • M Modern_night

                  VB.net theres no problem with showing forms after closing it in vb6 .. but i cant do it with vb.net hope you reply soon ... and thanx for care. لا اله الا الله محمد رسول الله

                  J Offline
                  J Offline
                  jamesbronw
                  wrote on last edited by
                  #8

                  If the program is still running, then on the form you are on use a button or a file menue option or some kind of event and recal the form you would like to open up. Its just like calling a form for the first time. if that doesnt make sence feel free to email me at iamydd@bellsouth.net

                  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