0

Hello everyone
we use a listview box and we add some path's of the files in list
and now we want to show the file icon with in file path
example:
listview1.item.add " D:\test.txt"
listview1.item.add " D:\picture.jpg"
now we want to show these files icon in my listview
please tell me what i do ?
thanks

2
Contributors
7
Replies
12
Views
4 Years
Discussion Span
Last Post by Jx_Man
0

Jx Man thanks for attaching this project
please dont mind but i want to do this
example:
we use a listview and make two column tabs
listview1.ListItems.Add , , "D:\test.txt"
Now we want to show this file icon in left or right side in the listview
when add any path of file in listview then it will show his file icon
please help

0

Add one icon with dimension 16x16 to Imagelist.
Then add this code :

Private Sub Command1_Click()
On Error Resume Next

    With ListView1
        Set .Icons = ImageList
        Set .SmallIcons = ImageList
        Set View = .ListItems.Add(, , , 1, 1) ' Icon Added
        View.SubItems(1) = "This/Where/Path/Added/" & .ListItems.Count 'Path Added
        View.SubItems(2) = "Size " & .ListItems.Count 'Size Added
    End With
End Sub
0

Thanks
but you mean every file which we add the list box first we added all icons them

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.