ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding icons to a listview on a userform (https://www.excelbanter.com/excel-programming/324479-adding-icons-listview-userform.html)

richard

Adding icons to a listview on a userform
 
Hi

Does anyone know why the icons for a listview (report
style) are not displayed, when the item is added?

There is no error. Just no icon displayed.

Thanks in advance

keepITcool

Adding icons to a listview on a userform
 


in the form:
check that you have an imagelist object
check that the imagelist contains 16x16 icons or bitmaps
check the KEYs for the images.

in the form's initialize procedure bind the imagelist
to the listview

Set lvwNames.SmallIcons = Me.imlForm


when adding items to the listview indicate which SmallIcon to use..

Set li = lvwNames.ListItems.Add( _
Key:="UniqueItemKey", _
Text:="Description", _
SmallIcon:="IconKey")


HTH :)




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Richard wrote :

Hi

Does anyone know why the icons for a listview (report
style) are not displayed, when the item is added?

There is no error. Just no icon displayed.

Thanks in advance



All times are GMT +1. The time now is 01:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com