oshirowanen
oshirowanen

Reputation: 15925

How do you get an application to close itself?

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?

Upvotes: 0

Views: 146

Answers (3)

Jay
Jay

Reputation: 152

You have

Me.dispose()
Me.close()

Interchange the two

Me.close()
Me.dispose()

and

Application.exit()

should work as well

Upvotes: 1

ømi
ømi

Reputation: 521

    Private Sub ButtonClose_Click() 
    Application.Exit

    End Sub

Upvotes: 1

Jelle Capenberghs
Jelle Capenberghs

Reputation: 794

Have you tried Application.Exit()?

Upvotes: 1

Related Questions