.NET Windows Forms Custom Controls
Authors: Weeks R.L
Published year: 2002
Pages: 7-8/74
Buy this book on amazon.com >>

Who Should Read This Book

To create custom controls it is assumed that you, the reader, have some knowledge of C# and .NET. In addition, you should be familiar with Windows Forms development. No prior knowledge of control development is required. The goal of this book is to teach control development.

It is also helpful if you have some knowledge of advanced C# topics such as attributes, custom events, and reflection. However, I have provided the needed information about these topics during the course of each control's development and as necessary. If you are new to programming, I suggest that you choose another avenue for learning, because this book is not geared toward teaching C# or .NET; rather, it shows you how to use C# and .NET to create your own controls.


This Book's Approach

To gain an understanding of what it takes to build controls for Windows Forms, this book takes a sample-based approach. The first control presented is a simple IconButton control. The IconButton control acts as a standard Windows Forms button, and in addition it allows for an icon image to be displayed on the control (see Figure 1).

Figure 1. The IconButton control developed in Chapters 2 and 3.

figure 1. the iconbutton control developed in chapters 2 and 3.

The IconButton serves as our first foray into custom control development. Although not very complicated, it shows how to get started with building controls and using the various services offered by VS .NET for control development.

With the basics of control development covered, we'll move on to advanced control development topics, including designer services, design-time verses runtime behavior, serialization, and licensing. To explore these topics, we'll develop an OutlookBar control, which is similar to the custom control found in MS Outlook. Figure 2 shows the OutlookBar control we will develop as the advanced sample for this book.

Figure 2. An advanced control, the OutlookBar .

figure 2. an advanced control, the outlookbar.

After you understand the concepts and tasks related to developing the IconButton control and the OutlookBar control, you will be well equipped to create other custom controls. You'll learn that the necessary requirements for creating custom controls are the development of a sense of flair and style, and, of course, knowledge of the requirements for building controls. This book arms you with that knowledge, and hopefully you will confidently develop your own sense of style with the knowledge and experience you gain from the samples in this book.

Again, the main goal of this book is to teach by example. I've packed as much code as possible into each section, including the appendix, which deals with Extender Providers. The code provided serves as a stepping-stone from which to extend the provided controls or to use as the building blocks for new controls.

Each chapter builds on the concepts and code examples of the preceding chapter. The controls built over the course of this book represent a starting point on which you should expand by adding your own features and support. The goal is to cover key concepts rather than extraneous features that don't contribute to understanding the process of custom control development.

.NET Windows Forms Custom Controls
Authors: Weeks R.L
Published year: 2002
Pages: 7-8/74

Similar books on Amazon