Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quiting an application

Status
Not open for further replies.

CookieNZ

MIS
Apr 22, 2002
48
0
0
NZ
Why does this code never quit the application?

Dim result As DialogResult

MsgBox("Are you sure you wish to quit the application?", MsgBoxStyle.YesNo)

If result = DialogResult.Yes Then
End
Else
Exit Sub
End If
 
coz your "result" is never store any data!!

TRY:

result = MsgBox("Are you sure you wish to quit the application?", MsgBoxStyle.YesNo)

. . .

OR

If MsgBox("Are you sure you wish to quit the application?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
End
End If

*p/s: MSDN will help
 
you may also what to look into:

Application.Exit()

instead of

End

I do not know the difference, but all the examples in MSDN shows Application.Exit() to exit an application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top