2

我一直在计划做一个ProgressBar让我ListView知道已经加载了多少百分比。有没有人有任何想法?

Public Class Form1

     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            ProgressBar1.Value += 2
            If ProgressBar1.Value >= 100 Then
                ProgressBar1.Value = 100
            End If
        End Sub

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            ProgressBar1.Minimum = 0
            ProgressBar1.Maximum = 100
            ProgressBar1.Value = 0
        End Sub
    End Class
4

1 回答 1

3

您有正确的想法,但您可能希望在加载列表视图而不是计时器滴答事件的代码中设置进度条值,因为您事先不知道需要多少时间。希望您能获得已加载列表视图的粗略百分比,然后将该值分配给ProgressBar1.Value.

于 2013-01-31T07:15:51.563 回答