Solved

Treeview like Windows Explorer

Posted on 2002-05-09
6
965 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
Industry Leaders: 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

623 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