views:

136

answers:

2

I am working on a project with some other developers and I notice that they created a custom component to create a readonly implementation of a combobox. But what is the difference between a component and a custom user control?

Why not use a custom user control for something like that?

A: 

You can use IComponent to implement components that have no UI, still you'd like to be able to manipulate instances on a design surface (such as Visual Studio). System.ComponentModel.BackgroundWorker is one example.

Why your colleagues would implement a ComboBox (a Control with UI, I suppose) I couldn't say - why don't you ask them?

Mark Seemann
cause it's an open Source project...
Tony
...but still..?
Mark Seemann
+1  A: 

The Component is the base class of all of controls. You've to derive your control from Component When you don't need any user interface.

http://msdn.microsoft.com/en-us/library/0b1dk63b.aspx

Mehdi Golchin