Firefox-like Download listbox
-
Has any one created a Listbox type control similar to the one that is found in the Firefox Download screen? Or something similar? I'd really appreciate the help!
Start out with a UserControl, and dub it "WorkList". Set "AutoScroll" to true. This will cause scrollbars to appear in the master-control when there's items that don't fit in the client-area. Create a new UserControl called "WorkItem" that holds: - a label - a progressBar A minimum & maximum-height of, e.g. 200. I assume that you'll be using backgroundWorkers to do the work, and that you're going to keep the progress of each thread in the "downloadlist". Whenever you create a new backgroundworker, you also create a new "WorkItem" usercontrol, and pass it as a parameter to the new thread. Set the
Dock
property to "Top", and it will snap in place in the list. In the.DoWork
of the backgroundworker, call thebackgroundWorker1.ReportProgress( ... )
method. This will raise thebackgroundWorker1_ProgressChanged
event, in which you update the progressBar of the associated "WorkItem"-usercontrol. If the Control is @100%, dispose :)I are Draenei, apparently, level 72 :doh: