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 a form when move one to another form

How to close a form when move one to another form

Scheduled Pinned Locked Moved Visual Basic
tutorial
6 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.
  • S Offline
    S Offline
    samarjeet sing
    wrote on last edited by
    #1

    I Have comleted our login form and when user input valid user name and password then he/she move to the MDI Form but I Want to close login form after enter valid username and password from samarjeet singh Kanpur(UP) india

    samarjeet singh (Software Engineer)

    Y M D 3 Replies Last reply
    0
    • S samarjeet sing

      I Have comleted our login form and when user input valid user name and password then he/she move to the MDI Form but I Want to close login form after enter valid username and password from samarjeet singh Kanpur(UP) india

      samarjeet singh (Software Engineer)

      Y Offline
      Y Offline
      yogesh_kumar_agarwal
      wrote on last edited by
      #2

      if you use VB then use unload function

      1 Reply Last reply
      0
      • S samarjeet sing

        I Have comleted our login form and when user input valid user name and password then he/she move to the MDI Form but I Want to close login form after enter valid username and password from samarjeet singh Kanpur(UP) india

        samarjeet singh (Software Engineer)

        M Offline
        M Offline
        manni_n
        wrote on last edited by
        #3

        well if your login form is startup form, and you are using VS2005 then just use closing_button_click() me.close() if using VS2003 then hide the form by me.hide() for closing the complete application , you can use application.exit()

        1 Reply Last reply
        0
        • S samarjeet sing

          I Have comleted our login form and when user input valid user name and password then he/she move to the MDI Form but I Want to close login form after enter valid username and password from samarjeet singh Kanpur(UP) india

          samarjeet singh (Software Engineer)

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

          You cannot set the Startup object to be the login form. Closing the startup form will close your entire application because the app's message pump is attached to it. Your startup form should be your applications main form. In that form's code, you check to see if the user is logged in, if not, then you put up the login form to get authenticated. There should be a button in the login form to Cancel the login. Your main form's code should take that to mean it should quit.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          T 1 Reply Last reply
          0
          • D Dave Kreskowiak

            You cannot set the Startup object to be the login form. Closing the startup form will close your entire application because the app's message pump is attached to it. Your startup form should be your applications main form. In that form's code, you check to see if the user is logged in, if not, then you put up the login form to get authenticated. There should be a button in the login form to Cancel the login. Your main form's code should take that to mean it should quit.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            T Offline
            T Offline
            The ANZAC
            wrote on last edited by
            #5

            But you can set it as the startup form and just tell it to hide (vs2005) without problems.

            Please check out my articles: The ANZAC's articles

            D 1 Reply Last reply
            0
            • T The ANZAC

              But you can set it as the startup form and just tell it to hide (vs2005) without problems.

              Please check out my articles: The ANZAC's articles

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

              Not a good desgin, but it works.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              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