Chapter 2. Control Basics

IN THIS CHAPTER

Controls provide a means for user interaction with an application. Every control defines a set of properties, events, and a user interface that represents the control and the intended use the control has. Control development consists of two parts: runtime and design-time. Runtime has to do with how the control looks and acts during the execution of the application, whereas design-time refers to the WYSIWYG editor used by VS .NET to create an application. In this chapter the runtime aspect of control development is the focus; Chapter 3, “Designer Basics,” covers the design-time aspects of control development.

This chapter covers the basics for creating a simple button control—the IconButton control. The IconButton control allows an Icon image to be displayed along with the standard text found on the Windows Forms button control (see Figure 2.1).

Figure 2.1. The IconButton control.


The IconButton control is a custom control. To build it, you need to understand the following topics:

The process of developing custom controls is the same as that of developing a set of classes. The process begins by determining the required functionality and the necessary classes that will be responsible for implementing the functionality. In addition, it is necessary to determine the proper base class for the custom control. Each class can inherit from a base class and implements zero or more interfaces. Classes also provide properties and even events. As you'll see in the following sections, custom controls behave much like classes do.

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

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