Domanda

How do I get an application to close itself?

At the moment, I have the following:

Private Sub Form1_Load()
    'do something first

    Me.Dispose()
    Me.Close()
End Sub

When I double click the .exe, the application seems to work fine, but I can still see an instance of it in the Windows Task Manager Processes tab.

How do I get it to close itself properly?

È stato utile?

Soluzione

You have

Me.dispose()
Me.close()

Interchange the two

Me.close()
Me.dispose()

and

Application.exit()

should work as well

Altri suggerimenti

Have you tried Application.Exit()?

    Private Sub ButtonClose_Click() 
    Application.Exit

    End Sub
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top