Search code examples
winformscontrolscomponents

Component vs. Control


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?

Solution

  • 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 to set properties and it can be disposed, that's all.

    Components still can have a runtime representation, OpenFileDialog being the best example. But that is actually a dialog built into Windows, not Windows Forms.