Component vs Class, when to use which

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

In VS.NET, you can add a plain class or a component class. What's the main
reasons for using one or the other? I know a component class derives from
System.ComponentModel.Component but not quite sure exactly what it has that
a plain class doesn't?

Thanks
Bob
 
In VS.NET, you can add a plain class or a component class. What's the main
reasons for using one or the other? I know a component class derives from
System.ComponentModel.Component but not quite sure exactly what it has that
a plain class doesn't?

A component can be placed in the Toolbox and dragged onto the design
surface of your VS.NET designer - i.e. you can see it in the property
inspector and set its public properties at design time.

A class doesn't support the design surface - you have to instantiate
it in code and use it from code - no visible design surface at design
time.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top