Controls.Remove

  • Thread starter Thread starter Tosch
  • Start date Start date
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
 
* 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.
 
Back
Top