Component vs Class, when to use which

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
 
M

Marc Scheuner [MVP ADSI]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top