Sunday, April 17, 2011

Progressbar in listbox?

I have a listbox that contains a bunch of file downloads, i want to add a progress bar to the current download to let the user know the progress of the download. I cannot figure out how to do this.

From stackoverflow
  • You need to use owner drawn list box

    Use a normal ListBox and set DrawMode = DrawMode.OwnerDrawFixed and handle the two events MeasureItem and DrawItem.

    The downside is that you have to take care of all the drawing yourself, but at least text and a progress bar are easy to draw.

  • Why ListBox? Use ListView, with a simple Google you find ton of ListView+Progress Bars.

0 comments:

Post a Comment