Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Sun Sep 09, 2007 5:12 am Post subject: HOWTO: Specify a custom thumbnail for a normal item. |
|
|
To specify a custom thumbnail to a normal item( that is, an item belonging to the shell's namespace and not added to FileView using AddCustomItem), use the following code in the OnAfterItemAdd event of FileView
[VB]
Private Sub FileView1_OnAfterItemAdd(ByVal Item As FileViewControl.IListItem)
' Only change icon index if FileView is in thumbnail mode
If FileView1.ViewStyle = Thumbnails Then
' Replace following condition with your own condition
' Only display a custom thumbnail for folders
If Item.IsFolder Then
Dim index As Integer
' Add a custom thumbnail to the thumbnail imagelist of FileView
index = FileView1.AddCustomIcon2("C:\my_thumbnail.bmp", Nothing, FIVILThumbnailsFramed)
' Change the iconindex of the item to that returned by the previous method
Item.IconIndex = index
End If
End If
End Sub |
|