[RESOLVED] The close (X) not working..
I copied this code from somewhere who suggested in this form for the (X) button on top left of my MDIParent ( frmmain ) form.. but when I press the button.. it simply exits the program without the popup.. whats wrong with the code
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Select Case MsgBox("Are You Sure You want to exit the Program?", vbYesNo, " Exit Application")
Case vbYes
Call closealldb
End
Case vbNo
Exit Sub
End Select
End Sub
Re: The close (X) not working..
Try this
vb Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim vbResponse As VbMsgBoxResult
vbResponse = MsgBox("Are You Sure You want to exit the Program?", vbYesNo, " Exit Application")
Select Case vbResponse
Case vbYes
Unload Me
Case vbNo
Cancel = -1
End Select
End Sub
Never, ever, ever use END.
Re: The close (X) not working..
not working still
am i suppose to change anything ?? like form_queryunload
it simply closes the MDI without asking for the msgbox
Re: The close (X) not working..
Quote:
Originally Posted by khandu
am i suppose to change anything ?? like form_queryunload
:confused: Yes...you are supposed to change what you have with what I posted.
Re: The close (X) not working..
Just a tip... NEVER use End ;) Forget that it even exists...
Re: The close (X) not working..
Quote:
Originally Posted by Hack
:confused: Yes...you are supposed to change what you have with what I posted.
ofcourse i did put your code.. that is not working too..
the close button just closes it without the msgbox coming..
Re: The close (X) not working..
Zip your project and attach it....I want to take a look.
Re: The close (X) not working..
Here..
it is a MDIparent form..
Can u modify and make it work..
also y is it not working ?? due to MDI parent??
Re: The close (X) not working..
I can't open .rar files.
Do you have Winzip?
Re: The close (X) not working..
If its an MDI app then are you trying to catch the MDIParent forms 'x' click? If so then its a different procedure.
vb Code:
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
End Sub
Re: The close (X) not working..
yep..
resolved and repped :)
Re: [RESOLVED] The close (X) not working..
Thanks. Btw, most members have winzip or some other zip utility. Not too many have winrar. ;)
Re: [RESOLVED] The close (X) not working..
Rob, grab a copy of 7Zip.
Re: [RESOLVED] The close (X) not working..
Naw but Thanks. I'm trying to keep my new system lite as possible. rar files are rare when compared to zip files. I dont even have winzip installed as Vista has compression/uncompression in zip format built in. :)