gettingstarted
[Top] [All Lists]

RE: hierarchical listboxes

To: "'Getting Started'" <gettingstarted at lists dot realsoftware dot com>
Subject: RE: hierarchical listboxes
From: "RBNUBE" <rbnube at mabenterprises dot com>
Date: Tue, 28 Feb 2006 21:06:07 -0500
Delivered-to: gettingstarted at lists dot realsoftware dot com
Importance: Normal
Keywords: RB-Getting Started
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>


<Prev in Thread] Current Thread [Next in Thread>
  • RE: hierarchical listboxes, RBNUBE <=