I have 2 windows form, 1 login form and 1 main form. I want to close main form and login form together. How can i do?
I tryed this command;
Form2 ac = new Form2();
ac.Show();
this.Close();
but this closing all forms. I want only close Form1.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your Main method contains:
And you are closing
form1, your application closes.You could “temporary” hide the form1 while displaying the ac. Use ShowDialog, to block your code until the ac form is closed: