Solved

Treeview items

Posted on 1997-04-21
2
218 Views
Last Modified: 2010-04-04
I have a file of strings like c:\acad\j\loop\unit-30.  I would like to build a tree from them without duplicating any nodes. The first node would be "c:", the second would be "acad" and so on.  The next string would be "c:\acad\j\loop\unit-31".  I don't want to have another level 1 node of "c:", In this case I would just like to add "unit-31" to the loop node as a child.
0
Comment
Question by:DPomeroy
2 Comments
 
LVL 3

Accepted Solution

by:
mheacock earned 50 total points
ID: 1335605
You atart at level one all the time...compare c: to everything at level one, if it exists, then go to level two off of that node, if it doesn't exist, then add it.  At level two you check to see if there is already a level two that matches the level two you are looking for, if so, then go to its level 3, if not add it.
0
 

Author Comment

by:DPomeroy
ID: 1335606
I can't figure out how to do the compare.  Do I you something like this.  If CurrentSubdirectory (c:) <> treeview1.node.text then addchild(CurrentSubdirectory)?  I still can't figure out how to access the properties of the class and what properties there are.  Also I can't figure out how to do the methods and I think I should be able to make a new class and add some more properties and methods.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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