Design

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.


The ImageListView control supports the following features:

  • Large images (32×32)

  • Small images (16×16)

  • 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.28.197