带有线程的进度条 [英] progress bar with threading
问题描述
您好
我正在使用带有进度条的c#windows窗体假设我正在从文件夹上传图像,当我们点击进度条时它应显示正在进行中我已经完成了10%的酒吧或者 20%或50% 并在完成上传
后,进度条应显示的图片 100%完成。我想使用线程来做,如果不是线程就没问题 任何帮助将不胜感激。等待你的回复
I am working with c# windows form with progress bar suppose i am uploading an image from a folder,when we click the progress bar it should show that in progress bar that i have completed now 10% or 20% or 50 % and after completion of uploading the images the progress bar should show 100% of completion . i want to do it using threading, no problem if not in threading Any help will be appreciated. waiting for your reply
推荐答案
穆罕默德,你应该使用进度条和
BackgroundWorker 。我不知道为什么你需要点击进度条,我不理解那部分(它已经代表进度,通过设置它的值)。
Hi, mohammad, you should use the progress bar alongside with the BackgroundWorker . I don't know why you need to click the progress Bar, I didn't understand that part (it already represents the progress, by setting it's value).
使用backgroundworker reportprogress方法并且它是更新进度变量的关联事件。您可以通过多种方式制作视觉价值(标签可以做得很好)。
Use the backgroundworker reportprogress method and it's associated event to update the progress var. You can make a visual value in several ways (label would do just fine).
问候,
Fá bio
Fábio
这篇关于带有线程的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!