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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





3766 Apr 7,2003 11:18 AM UTC Apr 8,2003 07:04 PM UTC WinForms 1
Tags: FAQ
Asked On April 7, 2003 11:18 AM UTC

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 07:04 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon