| title | Using an Image List | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | article | |||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | e0aed188-a1e6-400e-9f51-033d61c5541f | |||||||||||||
| caps.latest.revision | 10 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
Typical usage of an image list follows the pattern below:
-
Construct a CImageList object and call one of the overloads of its Create function to create an image list and attach it to the
CImageListobject. -
If you didn't add images when you created the image list, add images to the image list by calling the Add or Read member function.
-
Associate the image list with a control by calling the appropriate member function of that control, or draw images from the image list yourself using the image list's Draw member function.
-
Perhaps allow the user to drag an image, using the image list's built-in support for dragging.
Note
If the image list was created with the new operator, you must destroy the CImageList object when you are done with it.