Solved

Treeview like Windows Explorer

Posted on 2002-05-09
6
834 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now