I have a welcome to my application as it loads up, but then need to have that form close and login form open when the continue button is hit.
My code:
Me.Close()
Dim Login As New Form
Login.Show()
When I click the button it only closes the welcome form and then ends the application. If you can help thanks! :)
Using our example, we will wire up the button on the subForm to close the form. Click on the tab for the second form (the subForm) in your design and double click on the button control to display the Click event procedure. Press F5 to build and run the application.
If you want to close the form then use Me. Close() instead. The Load event will fire again when you create the new instance.
Add a new formRight-click on the project and choose Add > Form (Windows Forms). In the Name box, type a name for your form, such as MyNewForm. Visual Studio will provide a default and unique name that you may use.
You can set the properties of the project to select "When last form closes" in the shutdown mode dropdown
Update:-
"Project" menu -> 'YourApp' Properties... -> Application Tab
find : "Shutdown Mode"
Change from
"When startup form closes" --> "When last form closes"
show the form before the close.
Dim Login As New Form
Login.Show()
Me.Close()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With