ListItem Object
Object List Next Object
Definition:
An object that contains text and an icon associated with a ListView entry.
At any time, a ListItem can be made from the ListView control that refers to a
specific entry of the list. This ListItem object contains information specific
to that item, and provides an interface to altering the information.
Specialized Features:
The following table lists and describes the properties and methods that are
added by ListItem. There are no added events:
Property Use to…
Ghosted Specify whether or not a ListItem object in the ListView control is dimmed.
Icon, SmallIcon Set the index of an icon or small icon that accompanies a ListItem object
contained in an ImageList control.
Height Indicate the vertical size of the ListItem object.
Index Indicate which entry of the ListView control this item refers to.
Left Indicate the left edge of the item.
Selected A Boolean value that specifies whether or not this item is selected.
Text Specify the text that appears for this item.
Top Indicate the top edge of the item.
Width Indicate the horizontal size of the ListItem object.
Method Use to…
EnsureVisible Scrolls the ListView control enough so that this item is visible.
GetSubItem Retrieves the SubItem text of this item for the specified SubItemIndex.
SetSubItem Set the SubItem text of this item for the specified SubItemIndex.
Copied Features:
None—this is a top-level object.
Details:
ListItem objects can include images and text. To show an image, however, the
ListView control must have a reference to an ImageList object.
To change a particular image, you can use the Icon or SmallIcon property.