Solved

Treeview like Windows Explorer

Posted on 2002-05-09
6
925 Views
Last Modified: 2012-05-04
hello,

   how to make treeview like windows explorer's treeview?
the treview show all drives in my computer,
and when i click/select an item (drive or directory),
i can also show all contents (files & directorictories)
to my listbox..

and when i select a directory (in treeview), i can
cut/copy directory and paste to other directory..
(like windows explorer folder function)

ps : i'm using delphi 5
0
Comment
Question by:boyfn78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 62 total points
ID: 6998278
Hi

  this is shellListView that start to include with delphi 6, you can find similar components in torry site

http://www.torry.net/specialviews.htm

0
 
LVL 9

Assisted Solution

by:ginsonic
ginsonic earned 61 total points
ID: 6998334
procedure Populate(aTreeView: TTreeView; aRoot: TTreeNode;Path: string; Recurse: boolean);
var
 NewNode: TTreeNode;
 SRec: TSearchRec;
begin
 if FindFirst(Path + '*.*', SysUtils.faAnyFile, SRec) = 0 then
 repeat
   if (sRec.Name = '.') or (sRec.Name = '..') then
     Continue;
   NewNode := aTreeView.Items.AddChild(aRoot, SRec.Name);
   if Recurse and ((srec.Attr and sysutils.faDirectory) <> 0) then
     Populate(aTreeView, NewNode, Path + srec.name + '\', True);
 until
   FindNext(SRec) <> 0;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Populate(TreeView1, nil, 'c:\', True);
end;
0
 
LVL 2

Expert Comment

by:gallaghe
ID: 6998869
Take a look at the component ShellPack
http://www.arisesoft.com/shellpack/download.html

It includes a basic Explorer TreeView+ListView which show proper images for folders with special images along with proper file images. Pop both on a form, no coding and you have the usual array of copy/cut/drag operations.

What is really nice are some extra components which include a ComboBox with an Explorer TreeView. Other items you simply have to see.


Please note, even though you can download the full-source and demo project make sure to read the "License" agreement.
In short you can use it for free if not Commerical, if so the cost is $99 for site or $35 for single developer. IMHO $99 is overly priced but $35 is a fair amount for what this suite does and how much time you will save using it.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:ginsonic
ID: 6999153
or GXExplore (Tree and ListView ). Are freeware with source codes .
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7000172
... or checkout the Virtual Listview demo included with delphi :)
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9005429
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between mnasman and ginsonic

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question