Dave,
some of the components hold on unmanaged resources that needs to be released
upon destroing the component. Forms and UserControls use the container
collection to keep track of such components so they get disposed along with
the form or user control.
Beside this IContainer component collection are used in design time by the
desingener host to keep track of all objects on the design surface. However
it has nothing to do with the Container object that you see in the Form
class.
--
HTH
Stoitcho Goutsev (100)
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
When I create a new form a private member
System.ComponentModel.Container components
is created, and appears to be passed to the constructors of various things
like timers.
Can someone explain to me what the purpose of this is. It seems to have
something to do with the Dispose method. If I create (say) a timer
manually
in the code and don't pass the components object in the constructor
everything still seems to work OK.
--
Dave