I have two forms named:
Form1 & Form2
In the Form1 I have a button with this code in the button click event:
Form2.Show()
Me.Dispose()
When I click this button, it close both forms at the same time.
I only need to close the 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.
Your project settings are probably set to terminate the application when the startup form closes. Changing the option to “last form closes” should fix this.
“Project” menu -> ‘YourApp’ Properties… -> Application Tab
find : “Shutdown Mode”
Change from “When startup form closes” –> “When last form closes”