ListBox.AddFolder tip

I have a listbox where I keep a small column on the right with a gear icon for settings. Each row represents a MIDI song. If the song is multitrack, I collapse the tracks into a folder.

I discovered that when I use ListBox.AddFolder, there is no way to add anything into column 1 (2nd column). I couldn’t find any documentation or discussion about this, so I put my problem on the back burner. But I just discovered that if you add a normal row (with gear icon) and then change it to a folder, column 1 retains its contents. I’m now a happy camper (for the moment).

I thought I’d share my “eureka” moment here in case anyone has a similar issue.

You may be looking for the Listbox.Cell function which allows you to modify cells after adding them.
You don’t have to add a row with everything in it.

Thanks, Tim. I did try using ListBox.Cell to draw into column 1 after adding a folder and was not able to add anything. Of course, now that I recount this, I’m not absolutely sure, but I think that was a no go.

It definitely does work. That’s the method that I use for all of my hierarchical listboxes.

You’re not supposed to be able to do that. Don’t rely on that going forward.

Thanks, all. I tried Tim’s suggestion and it does work. I must have done something wrong the first time. I’ll adjust my code and move on.