Using Image Lists

Many components require images for their user interface. The ListView and TreeView classes can use images to enhance their appearances. Image lists are collections of bitmap images held in a single file. These images can have a transparent background keyed from a chosen color so that only the chosen portion of the image is shown.

The demo code for this section will be created as we go. Using Visual Studio, create a new C# application and call it imagelistdemo. Follow along for the rest of the chapter to complete the job.

To create an image list with Visual Studio, you should first drag an ImageList component from the toolbox onto the form. Now create some images. MS Paint is suitable for this task, just remember to save the ...

Get C# and the .NET Framework: The C++ Perspective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.