列表框中的进度条?
我有一个包含一堆文件下载的列表框,我想在当前下载中添加一个进度条,让用户知道下载的进度。 我不知道该怎么做。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用所有者绘制的列表框
使用普通的ListBox并设置DrawMode = DrawMode.OwnerDrawFixed并处理两个事件MeasureItem和DrawItem。
缺点是你必须自己处理所有的绘图,但至少文本和进度条很容易绘制。
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.
为什么是列表框? 使用ListView,通过简单的Google,你会发现大量的ListView+进度条。
Why ListBox? Use ListView, with a simple Google you find ton of ListView+Progress Bars.