We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Easy one: (?) how to kill instance of form class?

Thread ID:

Created:

Updated:

Platform:

Replies:

3766 Apr 7,2003 07:18 AM Apr 8,2003 03:04 PM Windows Forms 1
loading
Tags: FAQ
Jim
Asked On April 7, 2003 07:18 AM

I was wondering if there is a way to completely get rid of a form instance, no matter who has references to it. Suppose that I have a datatable on form frmList. I show frmDetail from a button of form list: dim f as new frmDetail f.Show Now suppose frmDetail adds a handler to a datatable that lives on frmList: AddHandler dtList.ColumnChanged, AddressOf ccHdlr Even If I put me.Dispose in frmDetail's closed event, changes to the datatable call the handler for the previous insantce of frmDetail. I thought my form was gone when I closed it, but it lives on through the handler. I know I can remove the handler in frmClosed. I was just wondering how to really trash the form, even if some other objects have references to it.

Ramesh Praveen [Syncfusion]
Replied On April 8, 2003 03:04 PM

You cannot do this. Whenever you do a AddHandler you should also do a ReleaseHandler (in this case in your form's Dispose) so that outstanding references will be removed. -Praveen

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;