Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?
like image 945
NileshChauhan Avatar asked Mar 23 '09 09:03

NileshChauhan


1 Answers

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.

like image 186
Hans Passant Avatar answered Oct 10 '22 23:10

Hans Passant