I have a WinForms TabControl that I am dynamically adding TabPages to at runtime. Each TabPage contains a WebBrowser control. I also have the ability to remove the TabPages at runtime.
Should I bother Dispose()ing the TabPage and/or WebBrowser controls?
It seems to me I should at least Dispose() the WebBrowser control since it is a bit of a resource hog.
You should Dispose() your tab page when you remove it. This will automatically dispose all of the child controls.
For details, see the Control.Dispose documentation:
The tab page’s dispose will also dispose of all of the children controls for you.