반응형
button 2개 timer 1개 label 2개 ProgressBar 1개를 위와 같이 배치합니다.,
timer 설정은 위와 같이 합니다.
Public Class Form1
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label1.Text += 1 ' Timer 틱마다 숫자 1씩 증가
ProgressBar1.Value = Label1.Text ' Label1.Text ProgressBar값으로 입력
If ProgressBar1.Value = 100 Then
Timer1.Stop()
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class
반응형