Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Specify a custom thumbnail for a normal item

 
Subscribe to the RSS feed for this forum  Forum Index -> FileView.Net/WPF
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Sun Sep 09, 2007 5:14 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 AfterItemAdd event of FileView

[C#]

private void fileView1_AfterItemAdd(object sender, LogicNP.FileViewControl.FileViewEventArgs e)

{

// Only change icon index if FileView is in thumbnail mode

if(fileView1.ViewStyle==ViewStyles.Thumbnails)

{

// Replace following condition with your own condition

// Only display a custom thumbnail for folders

if(e.Item.IsFolder())

{

// Add a custom thumbnail to the thumbnail image list of FileView

int index = fileView1.AddCustomIcon(new Bitmap(@"C:\my_thumbnail.bmp"),FileViewImageLists.ThumbnailFramed);

// Change the icon index of the item to that returned by the previous method

e.Item.IconIndex=index;

}

}

}
Back to top
Display posts from previous:   
Forum Index -> FileView.Net/WPF All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group