TIP: Click on subject to list as thread! ANSI
echo: visual_basic
to: All
from: Anthony Bopp
date: 2004-06-18 17:22:00
subject: Loading a treeview from a

I'm trying to figure out an efficient way to represent a text file in
a treeview control, but not being terribly experienced with either VB
or treeviews, every solution I come up with seems waaay to complex and
convoluted, and I'd appreciate any help in coming up with something
simpler.

Here's an example of how the text file is structured:

AnotherLayer sample_a1[] =
{
    { name("a1") },
    { test(test_a1x) }
    { test(test_a1y) }
    { test(test_a1z) }
};

AnotherLayer sample_a2[] =
{
    { name("a1") },
    { test(test_a2x) }
    { test(test_a2y) }
    { test(test_a2z) }
};

AnotherLayer sample_b1[] =
{
    { name("a1") },
    { test(test_b1x) }
    { test(test_b1y) }
    { test(test_b1z) }
};

AnotherLayer sample_b2[] =
{
    { name("a1") },
    { test(test_b2x) }
    { test(test_b2y) }
    { test(test_b2z) }
};

NextLayer layer_a[] =
{
   { name{"a") },
   { sample(sample_a1) },
   { sample(sample_a2) },
};

NextLayer layer_b[] =
{
   { name{"b") },
   { sample(sample_b1) },
   { sample(sample_b2) },
};

Layer [] =
{
    { layer(layer_a) },
    { layer(layer_b) }
};

I want my tree view to represent the text like this:

layer_a
  |_ Sample_a1
       |_ Test_a1x
       |_ Test_a1y
       |_ Test_a1z
  |_ Sample_a2

etc...

Part of my difficulty is that the text file is "upside down" from the
standpoint that what I want to be the parent nodes are actually at the
bottom of the file. Another difficulty is that I'm sure there must be
a relatively simple routine that can be used to populate all the
nodes, but I just can figure out what that routine is.

Help please?
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com

---
 * RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
 * RgateImp.MoonDog.BBS at 6/18/04 5:22:20 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)
SEEN-BY: 633/267 270
@PATH: 278/230 10/345 106/1 2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.