1st step is to select the Hierarchical property on the ListBox.
Shouldn't be too hard to modify this code to fit your needs.
Directly from the LR:
LB CollapseRow:
Dim i,u,NSubRows as Integer
NSubRows=CountFields(Me.cell(row,1),",")
u=row+1
For i=row+NSubRows downto u
Me.removerow i
Next
LB DoubleClick:
Me.expanded(Me.listindex)=Not Me.expanded(Me.listindex)
LB ExpandRow:
Dim s1 as string
Dim i,u as Integer
s1=me.cell(row,1)
u=CountFields(s1,",")
For i=1 to u
Me.addrow ""
Me.cell(me.lastIndex,0)=NthField(s1,",",i)
Next
LB Open:
Dim i, u as Integer
Dim s1,sub1 as string
Me.columnwidths="150,0"
s1="Michigan,Ohio,Minnesota"
sub1="Grand Blanc,Bad Axe,Flint,Benton Harbor,
Detroit;Cleveland,Columbus,Akron, Pleasantville; St. Paul,Frostbite Falls"
u=CountFields(s1,",")
For i=1 to u
If NthField(sub1,";",i)<> "" then
Me.addfolder ""
Me.cell(i-1,1)=NthField(sub1,";",i)
end if
Me.cell(i-1,0)=NthField(s1,",",i)
Next
Me.ColumnCount=1
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>