Solved

Treeview like Windows Explorer

Posted on 2002-05-09
6
879 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
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…

830 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