Page 1 of 1

VB.net sample code for DoDelete and DoSelectAll

Posted: Wed Aug 10, 2011 11:03 pm
by communi
Hi,
I found the simple sample in the helpfile but I think, I'm to stupid to use it ;-) I need a short sample code (VB.Net 2008) how I can select all thumbnails in ThumbnailViewer control and delete them (at first DoSelectAll, then DoDelete) by pressing a single button??

Thank you very much!!!!

Re: VB.net sample code for DoDelete and DoSelectAll

Posted: Fri Aug 12, 2011 12:45 pm
by Alex
Hello,

Here is a snippet of code:

Code: Select all

thumbnailViewer1.Images.Clear()
Best regards, Alexander

Re: VB.net sample code for DoDelete and DoSelectAll

Posted: Fri Aug 12, 2011 4:55 pm
by communi
Hi Alex,

thank you, but this does'nt work, I tried this already. The thumbnails are away from thumbnailviewer, but the files are still locked on harddisk and cannot be deleted :-( If I select all by pressing the shortcut and delete them by shortcut(pressing DEL) the files are no longer locked by the application and can be deleted. That the reason, why I need sample code for the DoDelete method. Or is there an another way to release the files from the thumbnailviewer so they can be deleted on the harddisk?

Thank you!!

Kai

Re: VB.net sample code for DoDelete and DoSelectAll

Posted: Fri Aug 12, 2011 6:45 pm
by Alex
Hello Kai,

Previous code clears the collection but does not dispose the items (VintasoftImage objects) of the collection.

You need to use this code if you want clear the collection and dispose items of the collection:

Code: Select all

thumbnailViewer1.Images.ClearAndDisposeItems()
Please read about the ImageCollection and ThumbnailViewer classes in the documentation.

Best regards, Alexander

Re: VB.net sample code for DoDelete and DoSelectAll

Posted: Sat Aug 13, 2011 3:54 pm
by communi
Hi Alex,

I tried also ClearAndDisposeItems before I posted here, but no luck, all images are locked on the harddisk until I close the application :-( I read the documentation several times, thats how I found the DoDelete and DoSelectAll methods, but I need some short sample code for this, because this seems the only way to delete the files from harddisk. Do you have a short sample for this both? As I said - if I would use the shortcuts in the ThumbnailViewer to select all and delete everything is fine and the files are no longer locked on the harddisk, so I must find a way to do this both actions by pressing a button.

Kai

Re: VB.net sample code for DoDelete and DoSelectAll

Posted: Sun Aug 14, 2011 7:42 am
by Alex
Hello Kai,

Please send your application or demo application which demonstrates your problem to support@vintasoft.com - we need reproduce the problem, I think you have a mistake in your code.

Best regadrs, Alexander