Advertisement
jsauto

Untitled

Apr 3rd, 2013
7,706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.13 KB | None | 0 0
  1. Public Class Form1  
  2.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  3.         ProgressBar2.Minimum = 0  '設定進度條最小值
  4.         ProgressBar2.Maximum = 100  '設定進度條最大值
  5.         Timer1.Enabled = False           '讓 timer1一開始不要計時,等START再計時
  6.     End Sub
  7.     '10秒跑完ProgressBar START
  8.     Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
  9.         Timer1.Enabled = True
  10.     End Sub
  11.     'STOP
  12.     Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
  13.         Timer1.Enabled = False
  14.     End Sub
  15.     'CLEAR  清除ProgressBar2的進度
  16.     Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
  17.         ProgressBar2.Value = 0
  18.     End Sub
  19.     Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
  20.         If ProgressBar2.Value < 100 Then
  21.             ProgressBar2.Value += ProgressBar2.Step
  22.         Else
  23.             Timer1.Enabled = False
  24.         End If
  25.     End Sub
  26. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement