|
-
Feb 28th, 2007, 03:55 PM
#1
Thread Starter
Member
[RESOLVED] 2005 no form.Close() event??
I'm working with 2005 today and need to put some code inside the closed() event of my form. But it isn't there in 2005?? The Closed(), Closing() events are not present in 2005 in the designer.
How do I execute some code while a form is closing or immediately thereafter in 2005??
Thanks.
Last edited by sooner; Mar 1st, 2007 at 01:23 PM.
-
Feb 28th, 2007, 04:26 PM
#2
Hyperactive Member
Re: [2005] no form.Close() event??
Closed() changed to FormClosed(). FormClosing() and FormClosed() are the new names.
Currently Using: VS 2005 Professional
-
Feb 28th, 2007, 04:41 PM
#3
Re: [2005] no form.Close() event??
Look under the "(FormName Events)" dropdown on the left side of the code behind window.
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 
-
Feb 28th, 2007, 05:18 PM
#4
Re: [2005] no form.Close() event??
 Originally Posted by RobDog888
Look under the "(FormName Events)" dropdown on the left side of the code behind window.
You're showing your VB heritage Rob. Those drop-down lists are not available in C#.
The Closing and Closed events still exist for compatibility but they are now obsolete. As tacoman667 suggested, the FormClosing and FormClosed events have been added and should be used in their stead. The differences that I'm aware of are that the new events get raised if you call Application.Exit whereas the old ones don't. The new events also provide a reason for the close. This makes doing things like minimising to the system tray instead of closing much easier because it's dead easy to test whether your form is closing because Windows is shutting down.
-
Feb 28th, 2007, 05:31 PM
#5
Re: [2005] no form.Close() event??
So right you are John. I've run into this more then once as I switch back and forth from .NET and VB 6 each and every day lol.
on the spot. )
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 
-
Feb 28th, 2007, 10:32 PM
#6
Fanatic Member
Re: [2005] no form.Close() event??
Last edited by popskie; Feb 28th, 2007 at 10:42 PM.
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
|