So,
As the subjects suggests I am noticing a problem with the ToolStripTextBox. The Class, through .Net Reflector, is shown to contain a private class ToolStripTextBoxControl which is a wrapper for the "TextBox" Win32 API element that is used by the ToolStripTextBox component. Through my memory leak analysis I have discovered that this internal control wrapper, when the visible property changes calls to a private method "HookStaticEvents" which accesses the Microsoft.Win32.SystemEvents.UserPreferenceChanged static event and attaches it to an instance method handler. Supposedly, when the visible property is set to false, and when the ToolStripTextBoxControl object is disposed, this event hook is released, but I have found that this does not always happen.
Via RedGate's ANTS program I have found multiple instances of a "forgotten" user Control which is being retained in memory by this very event hook, over which i have no control.
A) Has anyone else seen this issue before?
B) Does anyone know of a work around fix, or other such method by which we can enforce this static event is unhooked from the instance, thus allowing our usercontrol (and all its children) to be removed from memory by the GC?
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
"Never Trust a computer. Your brain is smarter than any micro-chip."
PS - Don't mark answers on other people's questions. There are such things as Vacations and Holidays which may reduce timely activity, and until the person asking the question can test your answer, it is not correct just because you think it is. Marking it
correct for them often stops other people from even reading the question and possibly providing the real "correct" answer.