Starting from a new project, drop a Listbox onto a window. Set its Hierarchical property to true and its ColumnCount to 3. Implement the Listbox.Open event handler --

Sub Open()
  me.AddFolder "California"
  me.AddFolder "Pennsylvania"
  me.AddFolder "Texas"
End Sub


Then implement its ExpandRow event handler.

Sub ExpandRow(row As Integer)
  dim Tab as String = Encodings.UTF8.Chr(9)
  dim state as String = me.Cell(row, 0)
  Select Case state
  Case "California"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Los Angeles" + Tab + "14,000,000" + Tab + "$690,000"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "San Francisco" + Tab + "3,000,000" + Tab + "$730,000"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "San Diego" + Tab + "7,000,000" + Tab + "$590,000"

  Case "Pennsylvania"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Pittsburgh" + Tab + "3,000,000" + Tab + "$730,000"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Philadelphia" + Tab + "3,000,000" + Tab + "$730,000"

  Case "Texas"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Austin" + Tab + "3,000,000" + Tab + "$730,000"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Dallas" + Tab + "3,000,000" + Tab + "$730,000"
    me.AddRow ""
me.Cell(me.LastIndex, -1) = "Houston" + Tab + "3,000,000" + Tab + "$730,000"

  Else
    //
  End Select
End Sub

This should demonstrate the behavior you're trying to achieve.

Charles Yeomans


On Jul 5, 2006, at 5:38 PM, [EMAIL PROTECTED] wrote:

I'm sorry, I am just not getting it. It seems you add a folder, and you a text string like "A, B, C ; D, E, F ". How do you get the third column? I set the
column count to 10 even and it doesn't pan out. Thanks.






Just add more columns by setting the ColumnCount property.

Charles Yeomans


I have been successful in getting the collapsable rows to work in
list boxes,
however there is a single column only. How can I have more columns,
like this
with cities of states, populations, and average home prices?

from :
California    >
Pennsylvania >
Texas   >


to :
California
      Los Angeles      14,000,000     $690,000
      San Francisco     3,000,000     $730,000
      San Diego            7,000,000     $590,000
Pennsylvania
      Pittsburgh       3,000,000     $730,000
      Philadelphia     3,000,000     $730,000
Texas
      Austin     3,000,000     $730,000
      Dallas     3,000,000     $730,000
      Houston       3,000,000     $730,000
      Dallas     3,000,000     $730,000


_______________________________________________
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>

_______________________________________________
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>

Reply via email to