Control Design

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

All Windows-based applications provide several well-known UI elements, such as menus, toolbars, and status bars. Beyond these basic UI elements, most modern applications provide their own custom set of controls and/or extend common UI elements to add some flair to the application. The leader and most-often-imitated UI elements are Microsoft's. MS Office has been a constant source of new UI elements and ideas for third-party control vendors. Advanced docking toolbars, custom menus, and windows are now available from several different vendors.

Users of Visual C++ and MFC (Microsoft Foundation Classes) have some basic UI elements afforded to them, such as simple docking toolbars. However, advanced UI elements such as those found in the latest edition of MS Office and VS .NET are not to be found within any provided framework or .NET classes. If you want your application to resemble a Microsoft application, you will have to purchase a set of libraries from a third-party vendor or create your own set of UI classes.

As with any type of project, certain criteria should be followed when creating custom UI elements. These are the criteria:

  • Looks cool

  • Looks really cool

  • Concise usage

  • Design-time support

Did I mention that it needs to look cool? After all, if you want your control to be noticed, it has to have a sexy wrapper. Consider the menus in VS .NET verses the standard menus available as part of Windows Forms development. Figure 6.1 shows a side-by-side comparison of these two menus.

Figure 6.1. A menu comparison VS .NET on the left, boring on the right.

figure 6.1. a menu comparison vs .net on the left, boring on the right.

Both menus shown in Figure 6.1 provide the same functionality; however, users looking at the two will believe that somehow, in some way, the cooler-looking menus translate into a more powerful application. When building a control, make sure that it (a) looks cool and (b) looks really cool.

Of course, if the control only looks cool but does not offer any functionality, it is useless. Creating a nice-looking control will get a developer's attention, and providing a useful control will get developers to actually use the control.



    .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