Custom controls are a key theme in .NET development. They can help your programming style by improving encapsulation, simplifying a programming model, and making user interface more “pluggable” (i.e., making it easier to swap out one control and replace it with a completely different one without rewriting your form code). Of course, custom controls can have other benefits, including the ability to transform a generic window into a state-of-the-art modern interface. Generally, developers tackle custom control development for one of three reasons:
  • To create controls that abstract away unimportant details and are tailored for a specific type of data. You saw this model in Chapter 6, with custom ListView and TreeView examples.

  • To create controls that provide entirely new functionality, or just combine existing UI elements in a unique way. An example of this is the directory browser control developed in this chapter.

  • To create controls with a distinct original look, or ones that mimic popular controls in professional applications (like Microsoft’s Outlook bar) that aren’t available to the masses. This topic is considered briefly in this chapter, and returned to in Chapter 13, with GDI+.


User Control Image Collection Visual Studio Tree View Dummy Node 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Matthew MacDonald 2002

Authors and Affiliations

  • Matthew MacDonald

There are no affiliations available

Personalised recommendations