Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- ProgressBar2.Minimum = 0 '設定進度條最小值
- ProgressBar2.Maximum = 100 '設定進度條最大值
- Timer1.Enabled = False '讓 timer1一開始不要計時,等START再計時
- End Sub
- '10秒跑完ProgressBar START
- Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
- Timer1.Enabled = True
- End Sub
- 'STOP
- Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
- Timer1.Enabled = False
- End Sub
- 'CLEAR 清除ProgressBar2的進度
- Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
- ProgressBar2.Value = 0
- End Sub
- Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
- If ProgressBar2.Value < 100 Then
- ProgressBar2.Value += ProgressBar2.Step
- Else
- Timer1.Enabled = False
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement