I don't know what would be a good title for this but I'll just explain.
I have two forms. When I run my login form, my main menu form will also visible but only behind my login form. Now, you might have some idea what i'm talking about? . My main menu form cannot be click unless the login form will be validated by inputting a username and password
it's working now but if I tried closing the login form clicking close from the title bar, the login form closes and I am able to use the other form. How could i make the close from the title bar close all the form.
But there's some bit of a problem. I said that there are two forms open, and I put my main menu as the startup windows form then I include in my Main_Load,
Login Login = new Login();
It opens the login form but when I tried to exit using my cancel button from login form which has a code of
DialogResult dlgResult = MessageBox.Show("Are you sure?", "Continue?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dlgResult == DialogResult.Yes)
Main Main = new Main();
The login form closes but not the main menu form. How to do this?
I'm not sure if it's what you want to do per-se but have you tried (when they choose to cancel) using Application.Exit() instead of just closing the forms? I assume if they cancel login you don't want the application running any longer.
Edit: What Farooqaa said :P (I stepped away for a bit and forgot to reload the thread to see if other answers were here before I replied)
Edit 2: And now, as it's 4am here... :zzz: Don't forget to mark the thread as solved once you're done resolving your issue.