Designer Base Classes

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); }

Like controls, designers have several base classes to choose from. Each designer base class provides certain functionality that builds on the support provided by the inherited base designer class. At the root of the designer hierarchy is the ComponentDesigner class.

Not every control in .NET is an actual control. Rather, certain items are components that derive from System.ComponentModel.Component. A component has no UI of its own and is often used to hold information for part of its containing control. The Windows Forms Menu and ImageList are two such components. When a component is placed on a Form object, an icon for the component appears within the Component Tray of VS .NET, as shown in Figure 5.2.

Figure 5.2. The VS .NET Component Tray.

figure 5.2. the vs .net component tray.

In Chapter 7, "OutlookBarTab Component," the Component class serves as the base class for the OutlookBarTab that is part of the OutlookBar control. Component-derived classes use the ComponentDesigner base class to provide the necessary designer implementation. The ComponentDesigner class implements IDisposable, IDesigner, and the IDesignerFilter interfaces. As such, component designers are capable of filtering properties, events, and attributes and have the capability to expose custom verbs. In addition, components designers can shadow properties and interact with the root document designer, which is the topmost designer. The Form designer is a document designer.



    .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