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. C#
  4. problem in opening the MDI parent form after succesful login

problem in opening the MDI parent form after succesful login

Scheduled Pinned Locked Moved C#
help
4 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.
  • I Offline
    I Offline
    I explore code
    wrote on last edited by
    #1

    hi, I have a login form which uses a user control designed for solely login purposes.I have 3 projects in my solution, one is the main MDI application (PETALSApp), one is the control library housing the login user control (PETALSControlLib) and the other is one that has the login form(SecurityServiceProvider). My idea is to open up a login form first and if the login is correct then close login window and open the MDI form. Now the problem is, after the successful login, to close the login window i have written this.FindForm().Close() in the user control's code for successful login, but this code not only closes the login window, but it also closes the MDI main form. I have added references as folowing: PETALSControlLib refers PETALSApp SecurityServiceProvider refers PETALSApp and PETALSControlLib Please help if there is a workaround for this

    S 1 Reply Last reply
    0
    • I I explore code

      hi, I have a login form which uses a user control designed for solely login purposes.I have 3 projects in my solution, one is the main MDI application (PETALSApp), one is the control library housing the login user control (PETALSControlLib) and the other is one that has the login form(SecurityServiceProvider). My idea is to open up a login form first and if the login is correct then close login window and open the MDI form. Now the problem is, after the successful login, to close the login window i have written this.FindForm().Close() in the user control's code for successful login, but this code not only closes the login window, but it also closes the MDI main form. I have added references as folowing: PETALSControlLib refers PETALSApp SecurityServiceProvider refers PETALSApp and PETALSControlLib Please help if there is a workaround for this

      S Offline
      S Offline
      satsumatable
      wrote on last edited by
      #2

      Once your log-in got validated try out the following this.Hide (); // It will hide your current window., frmMDI objMDI = new frmMDI (); // Create instance of your new one Application.DoEvents(); // To process all messages in Queue - NOT MUST objMDI.ShowDialog (); // POP-UP it

      I 1 Reply Last reply
      0
      • S satsumatable

        Once your log-in got validated try out the following this.Hide (); // It will hide your current window., frmMDI objMDI = new frmMDI (); // Create instance of your new one Application.DoEvents(); // To process all messages in Queue - NOT MUST objMDI.ShowDialog (); // POP-UP it

        I Offline
        I Offline
        I explore code
        wrote on last edited by
        #3

        hi, appreciate ur help, but Hide() would just make the form to vanish from the screen but it remains in memory and can be seen in task manager. just imagine if i open up 100 login windows, 100 instances would still be running in memory and this will lead memory performance issues. I need a workaround for this actually.

        S 1 Reply Last reply
        0
        • I I explore code

          hi, appreciate ur help, but Hide() would just make the form to vanish from the screen but it remains in memory and can be seen in task manager. just imagine if i open up 100 login windows, 100 instances would still be running in memory and this will lead memory performance issues. I need a workaround for this actually.

          S Offline
          S Offline
          satsumatable
          wrote on last edited by
          #4

          OK., i have assumed that as a Windows Application you would have only one instance, in your case i dont think so how it will work since once you close your main thread it will close entire stuff i.e there is no more resource to drive your application. Lets say you log in screen page contains Main () method and you are expecting to close that one, hence there is no more main () then how it your application will work around? Of course i might be wrong, if you come across any better soloution please post it across so that i can aware... :) Thanks Siva

          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