Hi,
I'm wondering whether this is a good thing or a bad thing and what I have to watchout for when calling Dispose.
I have a Tab (PageTab) that I extend and insert a Panel which has a listview and another Toolbar control into. These tabs then get inserted into a tab control (all native .NET WinForms controls).
When the user closes one of these tabs I call the Dispose method (which follows the MSDN way of implementing IDisposable.
I'm wondering whether its wise or suggested to declare the controls as ReadOnly:
protected readonly ListView _AccountsList = new ListView();
protected readonly Panel _Panel = new Panel();
because in the Dispose I just call _Panel.Dipose() etc on them but cannot set them to null. I want to avoid leaks as much as I can and have things GC'd.
Whats the best way for non-Designer GUI development and disposing them?