What is the base class form Windows Form?
If I create a new WinForms application, I can see that that Form1开发者_高级运维 inherits from Form. I thought that Form is a control. MSDN says that all controls inherit from UserControl class. Also how it is? EDIT: Also do all Forms inherit from base Form class?
Form
and UserControl
both derive separately from ContainerControl
, which derives from ScrollableControl
, which derives from Control
.
By Definition: Form acts like a container for controls.
In Windows Forms, a form is a visual surface on which you display information to the user. You ordinarily build Windows Forms applications by adding controls to forms and developing responses to user actions, such as mouse clicks or key presses.
A control is a discrete user interface (UI) element that displays data or accepts data input.
A Form isn't a control, it's a Window or Dialog box (as per the documentation).
精彩评论