|
-
Mar 1st, 2007, 10:29 AM
#1
Thread Starter
Addicted Member
[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
-
Mar 1st, 2007, 10:35 AM
#2
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.
-
Mar 1st, 2007, 11:08 AM
#3
Thread Starter
Addicted Member
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
-
Mar 1st, 2007, 11:29 AM
#4
Re: The close (X) not working..
 Originally Posted by khandu
am i suppose to change anything ?? like form_queryunload
Yes...you are supposed to change what you have with what I posted.
-
Mar 1st, 2007, 11:36 AM
#5
Re: The close (X) not working..
Just a tip... NEVER use End Forget that it even exists...
-
Mar 1st, 2007, 11:43 AM
#6
Thread Starter
Addicted Member
Re: The close (X) not working..
 Originally Posted by Hack
 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..
-
Mar 1st, 2007, 11:56 AM
#7
Re: The close (X) not working..
Zip your project and attach it....I want to take a look.
-
Mar 9th, 2007, 01:10 PM
#8
Thread Starter
Addicted Member
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??
Last edited by khandu; Mar 9th, 2007 at 02:37 PM.
-
Mar 9th, 2007, 01:27 PM
#9
Re: The close (X) not working..
I can't open .rar files.
Do you have Winzip?
-
Mar 9th, 2007, 01:35 PM
#10
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 9th, 2007, 02:34 PM
#11
Thread Starter
Addicted Member
Re: The close (X) not working..
yep..
resolved and repped
-
Mar 9th, 2007, 02:36 PM
#12
Re: [RESOLVED] The close (X) not working..
Thanks. Btw, most members have winzip or some other zip utility. Not too many have winrar. 
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 9th, 2007, 06:02 PM
#13
Re: [RESOLVED] The close (X) not working..
Rob, grab a copy of 7Zip.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Mar 9th, 2007, 06:46 PM
#14
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|