[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. :mad:
How do I execute some code while a form is closing or immediately thereafter in 2005??
Thanks.
Re: [2005] no form.Close() event??
Closed() changed to FormClosed(). FormClosing() and FormClosed() are the new names.
Re: [2005] no form.Close() event??
Look under the "(FormName Events)" dropdown on the left side of the code behind window.
Re: [2005] no form.Close() event??
Quote:
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.
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.
:thumb: on the spot. )
Re: [2005] no form.Close() event??