In the world of WinForms .Net controls
What is the difference between Component and Control?
- Can a Control contains any Component?
- Can a Component contains any Control?
In the world of WinForms .Net controls
What is the difference between Component and Control?
A Control has all the plumbing required to act as a window. The ability to respond to Window messages (WndProc) and having a Handle being foremost. Component is missing all that. It is really rather simple, it has design time support and it can be disposed, that's about it.
Components still can have a runtime representation, OpenFileDialog being the best example. But that is actually a dialog built into Windows, not Windows Forms.
A Component is just a representation of an object/sub API. eg. ImageList is a component which is invisible and is just an API into a set of images. The fact you can drag and drop them onto forms is just sugar in the designer.
A Control is intended to be visible/interactable/nestable.
In response to your comment, the Component and Control can be seen in the Object browser as being from different object hierarchies. A Component cannot be added within a Control, as the Controls collection only accepts objects with base type of Control.
A Component cannot contain Controls.
A component is basically a class (it can be a dll, Activex Object).
While on the other hand control is component which provides User Interface capabilities.