|
-
Mar 2nd, 2004, 01:49 PM
#1
Thread Starter
Lively Member
exiting problems[resolved]
i want to do a msgbox that prompts the user to exit, or not. problem is, even when you click 'no,' you still exit.
here's my code
VB Code:
Private Sub Form_Unload(Cancel As Integer)
Dim m As Integer
m = MsgBox ("Are you sure you want to exit?", vbExclamation + vbYesNo, "Exit?")
Select Case m
Case vbYes
Unload frmMain
Exit Sub
Case vbNo
Exit Sub
End Select
End Sub
what is wrong here?
thanks d00dz
Last edited by OsamaBinGhandi; Mar 2nd, 2004 at 01:56 PM.
-
Mar 2nd, 2004, 01:55 PM
#2
Thread Starter
Lively Member
oooook.....nevermind i fixed it.
had to set cancel = true under vbNo.
oh well
-
Mar 2nd, 2004, 06:41 PM
#3
You have to make Cancel = True or = -1
VB Code:
Private Sub Form_Unload(Cancel As Integer)
Dim m As Integer
m = MsgBox ("Are you sure you want to exit?", vbExclamation + vbYesNo, "Exit?")
Select Case m
Case vbYes
Unload frmMain
Case vbNo
Cancel = True
End Select
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|