UncleRonin
Well-known member
Okay, I know about using RemoveHandler which isn't a problem... What I really want to know is if there are other ways to remove handlers/handles?
I have a bunch of controls which are code generated and added to a form. I then perform some operation and if it fails I must then get rid of these controls and their associated handles. Can I use .Dispose() on the control and then this will automatically release any handles it may have or must I specifically use RemoveHandler?
I can get around this by reorganising my code so that handles are only added if the operation is successful but then I have to reiterate through all the controls which wastes time and I don't want that.
This isn't a major thing or anything but I'm really curious!
I have a bunch of controls which are code generated and added to a form. I then perform some operation and if it fails I must then get rid of these controls and their associated handles. Can I use .Dispose() on the control and then this will automatically release any handles it may have or must I specifically use RemoveHandler?
I can get around this by reorganising my code so that handles are only added if the operation is successful but then I have to reiterate through all the controls which wastes time and I don't want that.
This isn't a major thing or anything but I'm really curious!