AddHandler and RemoveHandler

  • Thread starter Thread starter Elisa
  • Start date Start date
E

Elisa

Hi,

If you add event handlers using AddHandler, do you have to explicitly
call RemoveHandler, or are event handlers automatically removed when the
listener goes "out of focus" (read: gets disposed)?


Regards,

Elisa
 
You should be ok not removing event handlers explicitly. The real reason to
do this would be for handlers not to run into ObjectDisposedException when
trying to retrieve some data from the form being destroyed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top