Solved

Treeview like Windows Explorer

Posted on 2002-05-09
6
810 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:
mnasman 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 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

16 Experts available now in Live!

Get 1:1 Help Now