Components and Controls Defined

A component is a class that implements the IComponent interface from the System.ComponentModel namespace. How to implement IComponent is covered in Chapter 9: Design-Time Integration, but any class that implements IComponent becomes a component and can thereafter be integrated with a component hosting environment, such as VS.NET. In VS.NET this integration means that the component can show up on the Toolbar, can be dropped onto a design surface (such as a Form), and can have public properties set and public events consumed in the Property Browser.

The chief difference between a control and a component is the location where the interaction with the user occurs (if there is an interaction with the user). A control ...

Get Windows Forms Programming in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.