Making icons appear in List View controls

Hi,

How do I make icons appear next to each row in a List View which is in lvwReport mode (in a similar way to Windows Explorer displaying a specific icon to represent the specific program each file is associated with).
gizzAsked:
Who is Participating?
 
halapayaConnect With a Mentor Commented:
for example u can do it this way

   ' Create an object variable for the ColumnHeader object.
   Dim clmX As ColumnHeader
   ' Add ColumnHeaders. The width of the columns is the width
   ' of the control divided by the number of ColumnHeader objects.

   Set clmX = ListView1.ColumnHeaders. _
   Add(, , "Company", ListView1.Width / 3)
   Set clmX = ListView1.ColumnHeaders. _
   Add(, , "Address", ListView1.Width / 3)
   Set clmX = ListView1.ColumnHeaders. _
   Add(, , "Phone", ListView1.Width / 3)
   
' Set BorderStyle property.
  ListView1.BorderStyle = ccFixedSingle

' Set View property to Report.
  ListView1.View = lvwReport    

'assing two image lists
'smallicons and one for normal icons

   ListView1.Icons = ImageList1
   ListView1.SmallIcons = ImageList2

'add an item to listview
Set itmX = ListView1.ListItems.Add(, , "item one")

' Set an icon from ImageList1.
itmX.Icon = 1        

'Set an icon from ImageList2.
itmX.SmallIcon = 1  
0
All Courses

From novice to tech pro — start learning today.