Component vs. Control

后端 未结 4 994
一生所求
一生所求 2021-02-20 08:46

In the world of WinForms .Net controls

What is the difference between Component and Control?

  • Can a Control contains any Component?
  • Can a Compone
4条回答
  •  Happy的楠姐
    2021-02-20 09:35

    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.

提交回复
热议问题