Introduction

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

Why write a book on custom controls? Well, there's an adage that says "sex sells." The premise of that adage is the same for developing custom controls and application development. Consumers tend to buy the pretty box, or the application with the slickest, most modern user interface. Prettiness also sells. Often, consumers make purchase decisions regardless of functionality. Custom control development serves two purposes: The first is to mimic user interface elements found in leading commercial products, and the second is to provide controls not found in the standard set of Windows common controls.

Examples of useful custom controls include spreadsheet-style controls, such as Spread from FarPoint Technologies, and the Outlook-style shortcut bar provided by various Toolkit vendors. These custom controls provide elements not found in the standard set of common controls and allow for application developers to concentrate on building the core logic of their application without having to spend time developing UI components. Custom controls often fill a specific need, as in the case of Spread, and other times merely enhance common UI elements such as customizable toolbars and menus.

In general, Microsoft has set the standard for application user interfaces. In fact, an entire industry has been created whose sole purpose is providing developers with UI Toolkits that emulate the same UI elements found in most Microsoft applications. Consider MS Office and VS .NET (Visual Studio .NET). Both of these applications have defined the expected UI elements in other commercial Windows applications such as Act, Work Force Vision by Peopleclick, and Visio. Companies that make their living selling custom controls are already releasing updated Toolkits to provide the UI elements found in VS .NET.

Developing custom controls has often been considered a poorly documented, Windows guru-only task. This doesn't have to be the case. Although poor documentation does exist, anyone with the proper documentation can create stunning, modern UI custom controls like those found in MS Office and VS .NET. Such a journey begins with this book.

Before you start this journey, it might be helpful to know how custom controls are defined. A custom control is just a common control that has been altered in either appearance or functionality to produce a desired effect. A custom control can also be a new control that doesn't have a counterpart within the Windows common controls. There's no hard-and-fast definition for what constitutes a custom control. Basically, just keep in mind that a custom control is not part of the Windows common controls.

The process of developing controls is not a single-sided effort. In fact, the .NET base class library provides an overwhelming set of base classes and interfaces targeted at control development and support. The base class library provides not only several control base classes, but also several designer base classes that can be extended to provide the design-time behavior for the control.

For those of you who've had the pleasure (read "torment") of developing ActiveX controls with Microsoft Foundation Class (MFC) or even ActiveX Template Library (ATL), you'll appreciate the amount of reusable code provided by the base class libraries. In fact, for simple controls it's possible to merely use one of the existing designers to support your new control.

The .NET Windows Forms framework has the capability to host both classic ActiveX controls and .NET controls, thus extending the life of existing ActiveX controls. I would expect that third-party UI control vendors will eventually port all of their existing ActiveX controls over to native .NET controls to benefit from the added support afforded by the base class libraries.



    .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