Authoring WinForms Components and Controls

Referring to our earlier discussion of Windows forms, components are nonvisual controls or classes. This is a good generic definition, but a more specific one is this: a component is any class that inherits from System.ComponentModel.IComponent. This particular interface provides support for designability and resource handling. If you need a designable control that does not have a user interface of its own, you work with a component. Controls are similar in function but not form; a control is a reusable chunk of code that does have a visual element to it.

Because Visual Studio provides a dedicated design surface for creating Windows Forms components, we cover this separately in this section. WPF projects also allow for custom controls and components, but in a fashion that is much more streamlined and integrated with the overall development of forms in the WPF world. We cover some of that content in our WPF chapter later in the book (Chapter 21).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset