Learn to write custom controls for ASP.NET Web pages or Windows Forms rich clients. Excerpt: Whether you are building a Windows Forms rich client application or an ASP.NET web application, the techniques for building components are identical. However, the techniques for building custom controls are quite a bit different. This chapter focuses on building custom controls for Windows Forms. We will start off by reviewing some of the characteristics of custom controls and components in some detail. Then we will move on to the practical side and develop some custom controls. We will consider several aspects of custom controls: * How to add properties to a custom control and inform Visual Studio .NET of default property values, so that the IDE can display properties in a way that makes it easy for other developers to reuse your control * How controls should behave when they participate in the tabbing order of a form and receive or lose the focus, including how to correctly display keyboard UI cues * How to how to generate your own events for a control * How to derive a custom control from an existing Windows Forms control, allowing you to easily add custom functionality to standard controls * How to build a custom control from several constituent controls, providing complex functionality that you can reuse in your applications Once we have done all that, we will finish off by looking at some of the more theoretical considerations of control design, which you might want to consider when you are working on your own commercial controls.