John,
The timer example aside.
I create a new Component when I want either a Visual Designer to help build
the class (by dragging & dropping other components onto it) or I want to
drag & drop this new Component onto another Visual Designer (such as another
Component or Form). Otherwise I create a Class.
I don't think I would create a new Component, just to drag a single
Component (System.Timer) onto it, unless that Component was easier to
configure from a Visual Designer then straight code.
Remember that Component is a Class that inherits from
System.ComponentModel.Component (more importantly they implement the
IComponent interface). The biggest benefit I see with Components is the
visual designer support in VS.NET.
Hope this helps
Jay
"John Granade" <jo**@granade.net> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
I'm sure this has been asked but after searching the Internet, I just can
find a clear answer. When should you add a component versus a class to
you Windows Forms application?
The timer is a good example. I'm planning to add a customer system.timer
to run that should be accessible from several forms so I don't want to use
the forms timer. Should I add this to a new class or new component?
Thanks,
John