GetItemImageIndex Function

Class

ListView and TreeView.

Action

Returns the index into the image list for treeviews or listviews containing icons.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

iIndex = object.GetItemImageIndex (liItem)
Variable Description
iIndex Index to the icon of the item the image list. INTEGER.
liItem Item in the listview or treeview. LISTITEM.

Notes

Items in some listviews and treeviews contain icons. For example, the treeview in the Advanced page in the Internet Options dialog box in Internet Explorer contains items with icons that represent check boxes, radio buttons, and so on, although they are not true check boxes or radio buttons. These icons are stored in an image list. GetItemImageIndex returns the index into the image list for the specified list item's icon. You can use GetItemImageIndex to ensure that your listview or treeview item is correctly set.

Example

	[ ] INTEGER iItem, iIndex
	[ ] STRING sText
	[-] for iItem = 2 to 3
		[ ] sText = Options.Advanced.OptionsTreeView.GetItemText(iItem)
		[ ] iIndex = Options.Advanced.OptionsTreeView.GetItemImageIndex(iItem)
		[ ] Print("{sText}: {iIndex}")
	[ ] 
	[ ] // Results (in the following, 0 represents a checked check box icon,
	[ ] // and 1 represents an unchecked check box icon)
	[ ] //
	[ ] // Show welcome message each time I log on: 0
	[ ] // Disable script debugging: 1