So right now, I'm so frustrated because there is ONE little problem that stops me from continue working on my programm.
I made a simple Login Form where the user must type in a password and when he failed after 3 attempts, the form will close. BUT if the user enters a correct password, a button will become visible and he can Login and another Form with the main programm will open. So I want to close the Login Form when the user presses the Login button and the Form 2 will appear. Simple Code:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
logint = 1
If you right click on your project and select the Propeties voice from the Popup menu and switch to the Application page you will notice a combobox that says:
Shutdown mode = When Startup Form close.
Your startup form is the Login form, so when it closes your app terminates. You can change this settings to
Shutdown mode = When last form closes.
However, pay attention to not have orphaned forms around your application otherwise it will never stop.
A better approach is to start your application with the normal form and in its constructor execute the login form. If the login form doesn't allow your application to continue, set a global variable and Close the main form in its Load event.