+3  A: 

The code you've shown doesn't really add a progress bar "to" a subitem. Rather, it takes a standalone progress bar and moves it to cover the space of the first two columns. That's what your AdjustProgressBar function does. It receives the bounding rectangle of the list item, which I think corresponds to the total width of all the columns. Then, it shifts the left side of the rectangle by the width of the first column, and it shifts the right side of the rectangle by the width of the second column.

You can adjust the coordinates of the progress bar however you want. For example, to make it cover the third column, shift the left side by the widths of the first two columns, and then set the right side to the left coordinate plus the third column's width.

But for that to work, you still need for the list item to have a subitem. You're just putting a progress bar on top of it, and you already have code to do that. You can't add an object as a subitem; a subitem is always text. The text can be blank, although for the benefit of screen readers that know how to read list views, it would be nice if you updated the text with the progress bar's value.

Rob Kennedy
Thanks Rob, I'll try this suggestion.
Brad
Is there a better way to do this?
Brad
Yes, I imagine there is. Since you're already handing the owner-draw event, just *draw a progress meter* in whichever cell you want. Then you don't need to worry about moving other controls, or about what happens when a cell scrolls out of view. Just paint in whatever rectangle you're given. You'll only be asked to paint cells that are visible. Read up on the `OnCustomDrawItem` event, and then post a new question if you have difficulties.
Rob Kennedy