Visual Basic - Progress Bar reset automatically

0

Good Night!

I'm doing a program in Visual Basic, and I need my Progress Bar to go back to 0 automatically when it reaches 100, and my timer stops when Progress Bar's Value reaches 100.

Can anyone help me?

Program Code

Public Class DevKit
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Dinheiro.Click

End Sub

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Experiencia.Click

End Sub

Private Sub ProgressBar1_Click(sender As Object, e As EventArgs) Handles RPGMakerBar.Click

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles RPGMaker.Click
    Timer1.Start()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    RPGMakerBar.Increment(1)
    If RPGMakerBar.Value = 100 Then
        QtdDinheiro.Text = QtdDinheiro.Text
    End If
    PctRPGMaker.Text = RPGMakerBar.Value & (" %")

End Sub

Private Sub Label1_Click_1(sender As Object, e As EventArgs) Handles PctRPGMaker.Click

End Sub
End Class
    
asked by anonymous 17.05.2017 / 00:09

1 answer

0

Add the following code inside the function

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    RPGMakerBar.Increment(1)
    If RPGMakerBar.Value = 100 Then
        QtdDinheiro.Text = QtdDinheiro.Text
        Timer1.Stop()
        RPGMakerBar.Value = 0
    End If
    PctRPGMaker.Text = RPGMakerBar.Value & (" %")

End Sub
    
22.05.2017 / 13:13