getIcon (rowIndex, columnIndex);
rowIndex. Row index.
columnIndex. Column index.
The getIcon method returns top and left coordinates of an icon by column or row index of list.
To execute the example create the ListBox component named listbox2 containing the ImageList non-visual component named imagelist2 (see IconListItem Constructor). Add a handler of the ItemSelected event used to output a message with coordinates of icon of the selected list element:
listbox2.ItemSelected.add(function(sender, args) {
alert(imagelist2.getIcon(listbox2.getSelectedItem().getRowIndex(),listbox2.getSelectedItem().getColumnIndex()));
});
After executing the example when selecting any element from the created list the message with the top and left coordinates of the icon is displayed.
See also: