Warm tip: This article is reproduced from stackoverflow.com, please click
delphi delphi-2010

how to show the files thumbnails like windows explorer in delphi?

发布于 2020-04-13 09:23:12

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?

Questioner
Galvion
Viewed
77
Ken White 2012-01-22 08:35

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.