How to open a new form but closing the old one in VB

BaeFell picture BaeFell · Aug 28, 2013 · Viewed 98.5k times · Source

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! :)

Answer

Rahul Tripathi picture Rahul Tripathi · Aug 28, 2013

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"