Tim,


Thanks for your answer. But why should I use a hidden column insteed of Celltag? So far I have used extensively the celltag in many listboxes (to store IDs from Database records) and it works fine?

I will still give a try at your solution when I have 2 minutes for myself, as this bug is bug...g me ;-)

Cheers,

Youri



Tim Jones wrote:
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>


_______________________________________________
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