• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

How to restrict TShellTreeview to only display file and folders

Hi all, does anybody know a way of using the  TShellTreeview in delphi to display only regular files and folders, excluding the recycle bin, control panel etc, but including network files (but not the actual computers etc).

If not is there a suitable commercial/freeware robust component available.

This is driving me nuts, I know there has to be asimple solution to this!

  • 2
1 Solution
Eddie ShipmanAll-around developerCommented:
You have to inherit from TShellTreeView and modify the Populate procedure to ignore the ones
you don't want to show.
Eddie ShipmanAll-around developerCommented:
You can also write an AddFolder event handler to ignore the ones you don't want:

procedure TForm1.ShellTreeView1AddFolder(Sender: TObject;
  AFolder: TShellFolder; var CanAdd: Boolean);
  if (AFolder.DisplayName = 'Recycle Bin') or
     (AFolder.DisplayName = 'My Documents') then
    CanAdd := False;


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now