Hi Youri,
Try using a hidden column instead of the CellTag property.
As you add each element, add the absolutepath of your folders to the hidden
column (assuming you're using 4 columns for display 0 - 3):
me.Cell(me.LastIndex, 4) = f.Item(x).AbsolutePath
Then, when you expand a folder's row, you use that column as your FolderItem
f = GetFolderItem(me.Cell(Me.ListIndex, r)
y = f.Count
for x = 1 to y
if f.item(x).Directory then
me.addfolder(f.item(x).DisplayName)
...
HTH
Tim
--
Tim Jones
[EMAIL PROTECTED]
Quoting Youri <[EMAIL PROTECTED]>:
>
>
> Hi,
>
>
> I am having trouble with a hierarchical listbox that displays iles and
> folders (seen on Mark's book page 282). On the ExpandRow event of the
> listbox, I have :
>
> dim f as FolderItem
> dim x,y as integer
>
> f = me.CellTag(row,0)
> y = f.count
>
> for x = 1 to y
> if f.item(x).Directory then
> me.addfolder(f.item(x).DisplayName)
> else
>
> // to avoid seeing invisible files under OS X
> if left(f.item(x).DisplayName,1) <> "." then
> me.addrow(f.item(x).DisplayName)
> end if
> end if
> me.celltag(me.LastIndex,0) = f.item(x)
> next
>
>
> It works fine the first time I expand the intial row (ie. Volume(0)). If
> I collapse the initial row, then, I can't expand it again.
>
> The code seems straight forward to me, but...
>
> Where is the bug then?
>
>
> TIA,
>
> Regards,
>
>
> Youri
> _______________________________________________
> 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>