I have a .NET 2005 desktop application (C #) that has a login form and an MDI form, which then have several subforms. All other forms open only in MDI form.
After the user logs in, I hide the login form and then show the MDI form, but when I close the MDI form, my application process does not end because the login form is still hidden. I want that when the user closes the MDI form, the whole application should close (essentially, the process should not be displayed in the task manager), because if every time the user closes and opens the application again and logs in, he will create some performance problems .
I am doing something like below:
//my login validation script, //after successful login this.Hide(); if (globalData.ObjMdiMain.IsDisposed) { globalData.ObjMdiMain = new mdiMain(); } globalData.ObjMdiMain.Show();
globalData is my static class where I create global objects that are required for the entire application. There I defined the ObjMdiMain object of my MDI form, and I refer to it here in the login form.
So, is there any method or function that will complete the entire process from the system, something like "Application.End ();" or something else?
Thanks!
Prashant
source share