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

Designing and building the ImageListView control appears to be harder than it actually is. The goal of the ImageListView control is to mimic the basic look and feel of the list of images hosted within the Outlook shortcut bar. These images include the Inbox, Today, Calendar, and Notes images, to name a few. Figure 9.1 shows our ImageListView control at both design-time (on the left) and runtime (on the right).

Figure 9.1. The ImageListView control.

figure 9.1. the imagelistview control.

The ImageListView control supports the following features:

  • Large images (32x32)

  • Small images (16x16)

  • Scrolling

  • Hover effect

Scrolling support is provided by "faking" a set of scroll-like buttons in the upper- and lower-right corners of the control. The other features are discussed throughout the remainder of this chapter.

Although the buttons appear to look and act as a standard Windows button, they are in fact just simple classes that provide basic drawing and hit testing. One of the key concepts when building controls is to make them as light as possible. This means that you should not waste unnecessary resources, such as window handles or GDI resources like brushes and pens.



    .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