Icon, SmallIcon Properties (ListItem Object)

       

Returns or sets the index or key value of an icon or small icon associated with a ListItem object in an ImageList control.

Syntax

object.Icon [= index]

object.SmallIcon [= index]

The Icon, SmallIcon properties syntax has the following parts:

Part Description
object An object expression that evaluates to a ListItem object.
index An integer or unique string that identifies an icon or small icon in an associated ImageList control. The integer is the value of the ListItem object's Index property; the string is the value of the Key property.

Remarks

Before you can use an icon in a ListItem object, you must associate an ImageList control with the ListView control containing the object. See the Icons, SmallIcons Properties (ListView Control) for more information. The example below shows the proper syntax:

ListView1.ListItems(1).SmallIcons=1

The images will appear when the ListView control is in SmallIcons view.