VB.NET progressbar backgroundworker

后端 未结 6 2133
梦如初夏
梦如初夏 2020-11-28 13:49

When my application starts, and it has just been upgraded, I am doing a local database update (sqlite).

It is like that: The user starts my app, and then I start th

6条回答
  •  生来不讨喜
    2020-11-28 14:16

    Maybe I dont understand the question, but isnt it really simple?

    For i = ProgressBar1.Minimum To ProgressBar1.Maximum
            ProgressBar1.Value = i
            ProgressBar1.Update()
            System.Threading.Thread.Sleep(25)
        Next
    

    The "Update" of Progressbar does the trick. Your code "blocks" (though I can not see, why it's desirable to have "application not respondig"), but the Progressbar gets updated.

    BTW: For Windows Vista/7 (progressbar animation) you might check this: ProgressBar is slow in Windows Forms

提交回复
热议问题