Reinitiating c# progressive count



  • I have in my code a progressBar, which is filled in 60 seconds, as I do so when I get in 60 seconds he starts counting again.

    private void timer_progress_Tick(object sender, EventArgs e)
    {
        pro_separacao.Increment(1);
    } 
    


  • Declare an int variable outside Timer.

    then in your teamr do this, very simple:

     private int segundos;
     private void timer1_Tick(object sender, EventArgs e)
     {
         segundos++;
         pro_separacao.Value = segundos;
    
     if (segundos >= 60)
         segundos = 0;
    

    }


Log in to reply
 


Suggested Topics

  • 2
  • 3
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 3
  • 2
  • 2
  • 2
  • 2