在进度条中做什么是什么意思?

在进度条中做什么是什么意思?

问题描述:

ProgressBar1.Visible = True
            With ProgressBar1
                .Style = ProgressBarStyle.Blocks
                .Step = 1
                .Minimum = 0
                .Maximum = 100
                .Value = 0
            End With

            Do
                Threading.Thread.Sleep(100)
                ProgressBar1.PerformStep()
            Loop Until ProgressBar1.Value >= ProgressBar1.Maximum


            If ProgressBar1.Maximum = 100

这只是一个演示 - 它在循环中没有任何用处,除了睡眠当前任务和执行一步。这样做的累积效果是使进度条以规定的速度平滑移动 - 每1/10秒(100ms == 1/10秒)一步,并在10秒内完成整个进度条。



你应该实际使用它(除非你只是试图减慢代码速度并使用户烦恼)
It's just a demo - it does nothing useful in the loop except sleep the current task and perform a step. The cumulative effect of this is to make the progress bar move smoothly at a defined speed - one step every 1/10th of a second (100ms == 1/10th second) and have the whole progress bar filled in 10 seconds.

It's nothing you should actually be using (unless you are just trying to slow you code down and annoy the user)