I use the TFileListBox
control to show lists of files. But I wonder how to show the file thumbnails in the same way that Windows Explorer does?
You should try using the ShellControls
components included in Delphi. (Note that David Heffernan sort of mentioned, and TLama made the initial specific suggestion in the first two comments to your question.) They're not installed by default in recent versions, so you'll have to install them yourself.
These instructions are for the version of Delphi you've indicated you're using (Delphi 2010) - they're the same basically for XE/XE2
, except they're in the Samples\Delphi\VCL\ShellControls
folder instead (and the Start
entry contains XE
or XE2
instead of 2010
, of course).
Use Start->All Programs
, navigate to the Embarcadero RAD Studio
or Embarcadero Delphi 2010
item, expand it, and choose Demos
. It's in the Win32
folder under DelphiWin32\VCLWin32\ShellControls
. Open and build the vclshlctrls.dproj
first, and then build and install the dclshlctrls.dproj
. You'll need to add the folder above to your Project->Options
in the search path for the compiler to be able to find them.
To install the components after building the second package, right-click on the project in the 'Project Manager' and choose 'Install' from the popup (context) menu. The 'Project Manager' in the default configuration is the area on the right edge of the screen that displays the files in the project. Remember, you need to build vclshlctrls
first, and then install dclshlctrls
, which is the design-time package.
You should then find the TShellListView
, TShellTreeView
, TShellComboBox
, and TShellChangeNotifier
components on your palette in the Samples
category.
@Ken, actually it was me who mentioned
ShellControls
with note that they have no thumbnail support. So, do they support thumbnails (I can't check that now but as I remember they don't) ?if ShellControls do not support thumbnail view, then this answer is incorrect.
ShellControls do not support thumbnail view with Delphi 2010. Do ShellControls support thumbnails in Delphi XE2?
@TLama: You're right. David mentioned a "shell aware list view", but you were the first to specifically mention the ShellControls. Corrected. AFA whether the ShellControls support thumbnails or not, I have no idea (I haven't had time to check). If you read the comments to the original question, Sidhi asked me to post these directions (first provided in those comments) as an answer to the question, and I did so. Since it was accepted, it must be what the asker wanted. kobik: Read the las sentence I wrote before your name - if the asker says it's the answer they wanted, it's not incorrect. :)
@Ken, I never read the comments, I looked at the question title which says:
how to show the files thumbnails like windows explorer in delphi?
. but if OP is happy with this, me happy too... :)