I'm having trouble with the code that is generated automatically by the WinForms designer, sometimes it generates code that uses the 'components' (IContainer) in the constructors of disposable components and other times it doesn't.
Here is some code. First the code that is generated in a clean new project with just one component on the form:
private void InitializeComponent()
this.components = new System.ComponentModel.Container();
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
this.errorProvider1.ContainerControl = this;
View Complete Post