i have developed a windows form application using c#.
it has 2 forms like login form and main form. When i enter the correct login credentials it should close(not hide) the login form and display the main form.
i used the following code
MainForm main=new MainForm();
this.hide();//close login form
main.show();//display main form
but when I close the main form using the cross mark(right upper corner) in the mdi container, the main form closes but the application is still running in the task manager.
If I use the following code instead of the previous code, application will close before main form display.
this.close()//close login form
main.show();//display main form
do i have to hide mdi container from the main form or is there any way to achieve this? please help.