The ControlDesigner Base Class

function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); }

The ControlDesigner Base Class

Just as .NET provides base classes for developing controls, there also exists a set of base classes for implementing designers. In Chapter 5, "Advanced Control Development," the designer base classes are covered in more detail; for now, the ControlDesigner base class is the focus.

The ControlDesigner base class provides the bare-bones functionality for designing a control. Figure 3.1 shows a UML diagram of the ControlDesigner inheritance chain and supported interfaces. UML, or Unified Modeling Language, diagrams are helpful tools for visualizing the various components and classes of any software project.

Figure 3.1. The ControlDesigner hierarchy.

figure 3.1. the controldesigner hierarchy.

The base class for ControlDesigner is ComponentDesigner. The ComponentDesigner base class provides support for general component design and is not intended to be used directly for providing design-time support for controls. Its purpose is to provide common functionality for component design-time support.

The ControlDesigner base class serves as a starting point for creating control designers and implements the necessary interfaces for VS .NET. The ControlDesigner base class will serve as the base class for the IconButtonDesigner developed in this chapter. Remember that each control has an associated designer class. This association between the control and its designer class is created by specifying the designer class of a control through the use of an attribute. The DesignerAttribute is used for this purpose.



    .NET Windows Forms Custom Controls
    User Interfaces in VB .NET: Windows Forms and Custom Controls
    ISBN: 1590590449
    EAN: 2147483647
    Year: 2002
    Pages: 74

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net