Icons, SmallIcons Properties

Purpose

Returns or sets the ImageList controls associated with the Icon and SmallIcon views in a ListView control.

Syntax

[Set = ] ListView.Icons [= imagelist ]

[Set = ] ListView.SmallIcons [= imagelist ]

imagelist:ImageList Object

Description

To associate an ImageList control with a ListView control at run time, set these properties to the desired ImageList control.

Each ListItem object in the ListView control also has Icon and SmallIcon properties, which index the ListImage objects and determine which image is displayed.

Once you associate an ImageList with the ListView control, you can use the value of either the Index property to refer to a ListImage object in a procedure.

Example

Ocx ImageList iml

Ocx ListView lv = "", 100, 10, 140, 250, 200

iml.ListImages.Add , , CreatePicture(LoadIcon(_INSTANCE, 1), False)

lv.Icons = iml

// or..

Set lv.SmallIcons = iml  // Set is optional

lv.Add , , "Icon", 1

Do : Sleep  : Until Me Is Nothing

See Also

ListView, ListItem

{Created by Sjouke Hamstra; Last updated: 10/10/2014 by James Gaite}