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