Mocco
Mocco

Reputation: 1223

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?

Upvotes: 0

Views: 2240

Answers (3)

sajoshi
sajoshi

Reputation: 2763

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.

Upvotes: 1

Gabe
Gabe

Reputation: 86718

Form and UserControl both derive separately from ContainerControl, which derives from ScrollableControl, which derives from Control.

Upvotes: 3

steinar
steinar

Reputation: 9653

A Form isn't a control, it's a Window or Dialog box (as per the documentation).

Upvotes: 0

Related Questions