Controls.Remove

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tosch

    Controls.Remove

    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
  • Herfried K. Wagner [MVP]

    #2
    Re: Controls.Remove

    * Tosch <tosch_nospam@s wissonline.ch> scripsit:[color=blue]
    > 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?[/color]

    AFAIS you will have to remove the handlers yourself.

    --
    Herfried K. Wagner [MVP]
    <http://dotnet.mvps.org/>

    Comment

    Working...