label4在(剩餘時間為:) 的後面
label6在(完成:)的後面
Dim secend As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ProgressBar1.Value = 0
secend = Val(TextBox1.Text)
ProgressBar1.Step = 100 / secend
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ProgressBar1.Value = ProgressBar1.Value + 10
Label6.Text = ProgressBar1.Value.ToString & ”%”
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ProgressBar1.Step = 20
ProgressBar1.PerformStep()
Label6.Text = ProgressBar1.Value.ToString & ”%”
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ProgressBar1.Value = 0
Label6.Text = ProgressBar1.Value.ToString & ”%”
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.PerformStep()
secend = secend - 1
If secend <= 0 Then
Timer1.Enabled = False
Exit Sub
End If
Label4.Text = secend.ToString & ”秒”
Label6.Text = ProgressBar1.Value.ToString & ”%”
End Sub
文章定位: