Simple question

H

Harry Simpson

I want to show a message box and when the user clicks ok exit the application:

If Not g_blnLocalDBExists Then 'Go ahead and shut the app down after the user closes out the message box

Dim result As New MsgBoxResult

result = MsgBox("No local database. Place PPC back in the cradle.", MsgBoxStyle.OKCancel + MsgBoxStyle.Critical, "No Data")

Select Case result

Case MsgBoxResult.OK

Application.Exit()

Case MsgBoxResult.Cancel

Application.Exit()

End Select

This particular snippet actually just hangs the app completely - clicking OK on the messagebox takes but nothing else can be clicked again....

What am i missing.

TIA

Harry
 
S

Steven Nagy

You might still have something open. Try disposing your bigger objects.
As far as I know, Application.Exit() won't close the app until all
objects are ready for Garbage collection.
Using the Close() method should be enough
 
H

Harry Simpson

Thanks Steven,

Actually changed the flow around a little and I'm able to close it down.

Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top