Controls.Remove

T

Tosch

I have an application where I dynamically add controls to a form.
Depending on some settings I also add the appropriate handlers using
AddHandler. Different handlers are added to say a textbex depending on
the datafield of the textbox.

At some point in my application I have to remove the controls again.

Does the Controls.Remove also remove all the event handlers? Or do I
have to worry about the handlers still 'floating' around and eating up
resources?

Tosch
 
H

Herfried K. Wagner [MVP]

* Tosch said:
I have an application where I dynamically add controls to a form.
Depending on some settings I also add the appropriate handlers using
AddHandler. Different handlers are added to say a textbex depending on
the datafield of the textbox.

At some point in my application I have to remove the controls again.

Does the Controls.Remove also remove all the event handlers? Or do I
have to worry about the handlers still 'floating' around and eating up
resources?

AFAIS you will have to remove the handlers yourself.
 

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

Top