每40秒减少进度条值 [英] Decrease Progressbar Value Every 40 Second
本文介绍了每40秒减少进度条值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello codeproject,
i有一个progressbar1控件,最大值= 100
i希望我的进度条值每40秒减少10个值。
所以在前40秒,我的进度条值= 90
和接下来的40 seconde,我的进度条值= 80
然后如果我的progressbar1值= 0,我需要一些消息框提醒..
这是我每1分钟执行一次消息箱的代码,但这不起作用
Hello codeproject,
i have a progressbar1 control with maximum value = 100
i want to my progressbar value decrease 10 value every 40 second.
so in the first 40 second, my progressbar value = 90
and next 40 seconde, my progressbar value = 80
and then if my progressbar1 value = 0 , i need some messagebox alert..
this is my code to execute messagebox every 1 minute but this is not working
Public Sub test()
Dim endTime As DateTime = DateTime.Now.AddMinutes(1)
While endTime < DateTime.Now
MessageBox.Show("asdsad")
End While
End Sub
有什么建议吗?
any suggestion?
推荐答案
查找如何使用计时器(System.Windows.Forms.Timer)。
如何在上面执行此操作将创建一个非常无响应的应用程序(或Windows可能会认为它不起作用,并询问您是否要将其关闭并使窗口变灰。)
Look up how to use Timers (System.Windows.Forms.Timer).
How you are doing it above will create a very unresponsive app (or windows may think its not working and ask if you want to close it and gray out the window).
这篇关于每40秒减少进度条值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文