Always when I try to change a icon of a listitem then the icon of the next item is changed instead.
lvListView.ListItems(a).IconIndex = newiconbehaves like:
lvListView.ListItems(a + 1).IconIndex = newiconI took a look at the source of your control and changed:
Friend Property Get fItemIconIndex(ByVal lIndex As Long) As Long pGetStyle lIndex , LVIF_IMAGE fItemIconIndex = m_tLV.iImageEnd PropertyFriend Property Let fItemIconIndex(ByVal lIndex As Long, ByVal lIconIndex As Long) pGetStyle lIndex , LVIF_IMAGE m_tLV.iImage = lIconIndex pSetIStyle lIndex , LVIF_IMAGEEnd Propertyto:
Friend Property Get fItemIconIndex(ByVal lIndex As Long) As Long pGetStyle lIndex - 1, LVIF_IMAGE fItemIconIndex = m_tLV.iImageEnd PropertyFriend Property Let fItemIconIndex(ByVal lIndex As Long, ByVal lIconIndex As Long) pGetStyle lIndex - 1, LVIF_IMAGE m_tLV.iImage = lIconIndex pSetIStyle lIndex - 1, LVIF_IMAGEEnd PropertyNow it is working fine :-)
|
Fixed as suggested. |